#include <time.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+time_t last;
+
+void keep_running(int _) {
+ time(&last);
+ puts("\nmarching on...");
+}
int main(void) {
- time_t last = 0;
+ puts("stops roughly at 15-minute time boundaries");
+ puts("CTRL+C for no stop in the next 5 minutes");
+ puts("stop with ctrl+\\ (SIGQUIT)");
+ signal(SIGQUIT, exit);
+ signal(SIGINT, keep_running);
while(1) {
sleep(30);
time_t unixtime = time(NULL);