aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-06-26 06:47:18 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-06-26 06:47:18 +0000
commit2443e1f38c38c4fe2611e330990dfe6296da19aa (patch)
treec9231676629032bb12da28685df8a87cda24d1bb /lib
parenteb164098b770831a1055b2608c632c5013108d5a (diff)
T. Bharath fixed his mm lib timer resolution fix
Diffstat (limited to 'lib')
-rw-r--r--lib/timeval.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/timeval.c b/lib/timeval.c
index 140bc5506..664f6a96d 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -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;
}