]> sourceware.org Git - newlib-cygwin.git/commitdiff
* times.cc (clock_getres): Use correct conversion from milliseconds to
authorChristopher Faylor <me@cgf.cx>
Sat, 11 Feb 2006 00:06:50 +0000 (00:06 +0000)
committerChristopher Faylor <me@cgf.cx>
Sat, 11 Feb 2006 00:06:50 +0000 (00:06 +0000)
seconds/nanoseconds.
(clock_setres): Use correct conversion to nanoseconds.

winsup/cygwin/ChangeLog
winsup/cygwin/pinfo.cc
winsup/cygwin/times.cc

index 824de565e5764efd005379c74989043a7ec20acf..71ad3662660788585563a3a6aa3be6cbdc2e34a3 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-10  Brian Ford  <Brian.Ford@FlightSafety.com>
+
+       * times.cc (clock_getres): Use correct conversion from milliseconds to
+       seconds/nanoseconds.
+       (clock_setres): Use correct conversion to nanoseconds.
+
 2006-02-10  Christopher Faylor  <cgf@timesys.com>
 
        * external.cc (sync_winenv): Rename from "setup_winenv".  Use same
index c71299ff05a004827eb29aced67909de26c0908e..20db4e133743f4e846803d6563c0674d403f057a 100644 (file)
@@ -61,7 +61,7 @@ set_myself (HANDLE h)
       /* here if execed */
       static pinfo NO_COPY myself_identity;
       myself_identity.init (cygwin_pid (myself->dwProcessId), PID_EXECED, NULL);
-      myself->start_time = time (NULL); /* Register our starting time. */
+      // myself->start_time = time (NULL); /* Register our starting time. */
       myself->exec_sendsig = NULL;
       myself->exec_dwProcessId = 0;
     }
index ba387bfd603d343e5f79ee387c07a9b9cdd17d20..3922caf3143efc460e46767c6b38125b8cddf531 100644 (file)
@@ -711,8 +711,8 @@ clock_getres (clockid_t clk_id, struct timespec *tp)
 
   DWORD period = gtod.resolution ();
 
-  tp->tv_sec = period / 1000000;
-  tp->tv_nsec = (period % 1000000) * 1000;
+  tp->tv_sec = period / 1000;
+  tp->tv_nsec = (period % 1000) * 1000000;
 
   return 0;
 }
@@ -730,7 +730,7 @@ clock_setres (clockid_t clk_id, struct timespec *tp)
   if (period_set)
     timeEndPeriod (minperiod);
 
-  DWORD period = (tp->tv_sec * 1000) + ((tp->tv_nsec) / 1000);
+  DWORD period = (tp->tv_sec * 1000) + ((tp->tv_nsec) / 1000000);
 
   if (timeBeginPeriod (period))
     {
This page took 0.03531 seconds and 5 git commands to generate.