]> granicus.if.org Git - curl/commitdiff
T. Bharath fixed his mm lib timer resolution fix
authorDaniel Stenberg <daniel@haxx.se>
Wed, 26 Jun 2002 06:47:18 +0000 (06:47 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 26 Jun 2002 06:47:18 +0000 (06:47 +0000)
lib/timeval.c

index 140bc55060a9266ae870c7ab61b18f495767ecc9..664f6a96dca9ef98484784691db89ab2ab327b27 100644 (file)
@@ -56,10 +56,14 @@ gettimeofday (struct timeval *tp, void *nothing)
    ** of 1ms.Need to link against winmm.lib for this
    **/
   unsigned long Ticks = 0;
+  unsigned long Sec =0;
+  unsigned long Usec = 0;
   Ticks = timeGetTime();
-  tp->tv_sec = Ticks%1000;
-  tp->tv_usec = (Ticks - (tp->tv_sec*1000))*1000;
-  
+
+  Sec = Ticks/1000;
+  Usec = (Ticks - (Sec*1000))*1000;
+  tp->tv_sec = Sec;
+  tp->tv_usec = Usec;
 #endif
   return 1;
 }