diff options
author | Ashish Gupta <ashmew2@gmail.com> | 2017-09-22 00:28:30 +0200 |
---|---|---|
committer | Ashish Gupta <ashmew2@gmail.com> | 2017-10-25 22:04:55 +0200 |
commit | 8a94c69a80c18a2226e512a8c2628582476dc6a2 (patch) | |
tree | d419dc17991427c358e8893283fcbb1ee62d9b33 /utils/log.c | |
parent | 2e26f10be9901e1675ff9f41e5125e164a2057d4 (diff) | |
download | netsurf-8a94c69a80c18a2226e512a8c2628582476dc6a2.tar.gz netsurf-8a94c69a80c18a2226e512a8c2628582476dc6a2.tar.bz2 |
Fix polling
Diffstat (limited to 'utils/log.c')
-rw-r--r-- | utils/log.c | 16 |
1 files changed, 2 insertions, 14 deletions
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 <stdarg.h> #include <stdio.h> +#include <kos32sys.h> #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; } |