1 /* Program to produce output at regular intervals. */
3 #include <../src/config.h>
5 #if __STDC__ || defined(STDC_HEADERS)
11 #include <sys/types.h>
14 #define WIN32_LEAN_AND_MEAN
17 #define sleep(t) Sleep ((t) * 1000)
19 #undef HAVE_SYS_TIME_H
20 #endif /* WINDOWSNT */
22 #ifdef TIME_WITH_SYS_TIME
26 #ifdef HAVE_SYS_TIME_H
34 main (int argc, char *argv[])
39 period = atoi (argv[1]);
43 /* Make sure wakeup stops when Emacs goes away. */
46 printf ("Wake up!\n");
47 /* If fflush fails, then our stdout pipe is broken. */
48 if (fflush (stdout) != 0)
50 /* If using a period of 60, produce the output when the minute
57 tp = localtime (&when);
58 sleep (60 - tp->tm_sec);