From 4fa8a4e0ab52d5e804e3d85c04281d392c767b22 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 21 Apr 2011 20:49:22 +0200 Subject: get time at the beginning of the loop --- src/print_time.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/print_time.c b/src/print_time.c index 2cf2ab3..9c9df90 100644 --- a/src/print_time.c +++ b/src/print_time.c @@ -3,14 +3,9 @@ #include #include -void print_time(const char *format) { +void print_time(const char *format, struct tm *current_tm) { static char part[512]; /* Get date & time */ - time_t current_time = time(NULL); - if (current_time == (time_t) -1) { - return; - } - struct tm *current_tm = localtime(¤t_time); if (current_tm == NULL) { return; } -- cgit v1.2.3