1 /* Program to produce output at regular intervals. */
5 #if __STDC__ || defined(STDC_HEADERS)
13 #include <sys/types.h>
16 #define WIN32_LEAN_AND_MEAN
19 #define sleep(t) Sleep ((t) * 1000)
21 #undef HAVE_SYS_TIME_H
22 #endif /* WIN32_NATIVE */
24 #ifdef TIME_WITH_SYS_TIME
28 #ifdef HAVE_SYS_TIME_H
36 main (int argc, char *argv[])
41 period = atoi (argv[1]);
45 /* Make sure wakeup stops when Emacs goes away. */
48 printf ("Wake up!\n");
49 /* If fflush fails, then our stdout pipe is broken. */
50 if (fflush (stdout) != 0)
52 /* If using a period of 60, produce the output when the minute
59 tp = localtime (&when);
60 sleep (60 - tp->tm_sec);