From 947245db6ffbcb91c1ebd22aba6748259b441fd2 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Fri, 4 Mar 2022 10:14:27 +0100 Subject: [PATCH] tmr: reuse tmr_jiffies_usec (#259) --- src/tmr/tmr.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/tmr/tmr.c b/src/tmr/tmr.c index 5e9022c9d..7496b89c4 100644 --- a/src/tmr/tmr.c +++ b/src/tmr/tmr.c @@ -166,28 +166,7 @@ uint64_t tmr_jiffies_usec(void) */ uint64_t tmr_jiffies(void) { - uint64_t jfs; - -#if defined(WIN32) - FILETIME ft; - ULARGE_INTEGER li; - GetSystemTimeAsFileTime(&ft); - li.LowPart = ft.dwLowDateTime; - li.HighPart = ft.dwHighDateTime; - jfs = li.QuadPart/10/1000; -#else - struct timeval now; - - if (0 != gettimeofday(&now, NULL)) { - DEBUG_WARNING("jiffies: gettimeofday() failed (%m)\n", errno); - return 0; - } - - jfs = (long)now.tv_sec * (uint64_t)1000; - jfs += now.tv_usec / 1000; -#endif - - return jfs; + return tmr_jiffies_usec() / 1000; }