#include <time.h>
#include <string.h>
#include <conio.h>

#define ESC 0x1b

int main(int argc, char *argv[])
{
  char timebuf[9];
  char timeold[9];

  if (argc<2) exit(1);

  do {
       _strtime(timebuf);

       if (strcmp(timebuf, timeold))
	 {
	   printf("\r%s",timebuf);
	   strcpy(timeold,timebuf);
	 }

       if (kbhit())
	 {
	   if (getch()==ESC) exit(1);
	 }

      }
  while (strncmp(argv[1], timebuf, 5));

  return 0;
}