2004-09-28 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / misc.c
index 018ca108ff746a4b91f365f43a9d043e5fa9bf37..9d2f427a2e1ca357800ea1475cd32cdfc32c94dd 100644 (file)
@@ -18,12 +18,12 @@ void _wapi_calc_timeout(struct timespec *timeout, guint32 ms)
 {
        struct timeval now;
        div_t divvy;
-               
+
        gettimeofday(&now, NULL);
-       divvy=div(now.tv_usec+1000*ms, 1000000);
+       divvy=div((now.tv_usec/1000)+ms, 1000);
                
        timeout->tv_sec=now.tv_sec+divvy.quot;
-       timeout->tv_nsec=divvy.rem*1000;
+       timeout->tv_nsec=divvy.rem*1000000;
 }
 
 /* This is used instead of g_renew when we need to keep unused