From 652b5b0548603aff539e67b22ad7461bff0cb7cc Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Thu, 9 Jan 2014 10:41:27 +0100 Subject: [PATCH] win32: improve way to get current tick count in tests {#187) --- tests/bandwidth-client.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/bandwidth-client.c b/tests/bandwidth-client.c index 90857cb..4cb9e90 100644 --- a/tests/bandwidth-client.c +++ b/tests/bandwidth-client.c @@ -33,16 +33,11 @@ static uint32_t gettime_ms(void) { struct timeval tv; #if !defined(_MSC_VER) - gettimeofday (&tv, NULL); + gettimeofday(&tv, NULL); + return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; #else - SYSTEMTIME st; - - GetLocalTime(&st); - tv.tv_sec = st.wSecond; - tv.tv_usec = st.wMilliseconds * 1000; + return GetTickCount(); #endif - - return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; } enum { -- libgit2 0.21.4