From 8a94c69a80c18a2226e512a8c2628582476dc6a2 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Fri, 22 Sep 2017 00:28:30 +0200 Subject: Fix polling --- utils/log.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'utils') diff --git a/utils/log.c b/utils/log.c index 45cc2100f..eb7bb9a7d 100644 --- a/utils/log.c +++ b/utils/log.c @@ -19,6 +19,7 @@ #include #include +#include #include "utils/config.h" #include "utils/nsoption.h" #include "utils/sys_time.h" @@ -71,21 +72,8 @@ timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y) */ static const char *nslog_gettime(void) { - static struct timeval start_tv; static char buff[32]; - - struct timeval tv; - struct timeval now_tv; - - if (!timerisset(&start_tv)) { - gettimeofday(&start_tv, NULL); - } - gettimeofday(&now_tv, NULL); - - timeval_subtract(&tv, &now_tv, &start_tv); - - snprintf(buff, sizeof(buff),"(%ld.%06ld)", - (long)tv.tv_sec, (long)tv.tv_usec); + snprintf(buff, sizeof(buff),"(%u)", get_tick_count()); return buff; } -- cgit v1.2.3