From 16d5383fb8153a4bd48c7cdee1163349ad7e6e98 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Wed, 18 Jul 2018 11:05:54 +0200 Subject: [PATCH] Add timestamped "starting" message --- echoc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/echoc.c b/echoc.c index eaed4e5..5eeaaa6 100644 --- a/echoc.c +++ b/echoc.c @@ -185,6 +185,9 @@ main(int argc, char *argv[]) err(2, "setitimer"); gettimeofday(&last_ts, NULL); + tm = localtime((time_t *)&last_ts.tv_sec); + strftime(date, sizeof(date), "%F %T", tm); + printf("%s.%06ld: starting\n", date, last_ts.tv_usec); while (1) { /* poll() loop to handle interruptions by SIGALRM */