summaryrefslogtreecommitdiff
path: root/src/print_time.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2011-04-21 20:49:22 +0200
committerMichael Stapelberg <michael@stapelberg.de>2011-04-21 20:50:14 +0200
commit4fa8a4e0ab52d5e804e3d85c04281d392c767b22 (patch)
tree5b72d54482ba3512f27fca5e878563185567a38c /src/print_time.c
parent686b8798aa725eb5303d154c193e30766bd00094 (diff)
get time at the beginning of the loop
Diffstat (limited to 'src/print_time.c')
-rw-r--r--src/print_time.c7
1 files changed, 1 insertions, 6 deletions
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 <stdio.h>
#include <stdlib.h>
-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(&current_time);
if (current_tm == NULL) {
return;
}