Commit 652b5b0548603aff539e67b22ad7461bff0cb7cc

Authored by Stéphane Raimbault
1 parent 24a05ebd

win32: improve way to get current tick count in tests {#187)

Thanks to vgrin for the report
Showing 1 changed file with 3 additions and 8 deletions
tests/bandwidth-client.c
@@ -33,16 +33,11 @@ static uint32_t gettime_ms(void) @@ -33,16 +33,11 @@ static uint32_t gettime_ms(void)
33 { 33 {
34 struct timeval tv; 34 struct timeval tv;
35 #if !defined(_MSC_VER) 35 #if !defined(_MSC_VER)
36 - gettimeofday (&tv, NULL); 36 + gettimeofday(&tv, NULL);
  37 + return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000;
37 #else 38 #else
38 - SYSTEMTIME st;  
39 -  
40 - GetLocalTime(&st);  
41 - tv.tv_sec = st.wSecond;  
42 - tv.tv_usec = st.wMilliseconds * 1000; 39 + return GetTickCount();
43 #endif 40 #endif
44 -  
45 - return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000;  
46 } 41 }
47 42
48 enum { 43 enum {