diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-06-30 19:50:08 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-06-30 19:50:08 +0400 |
commit | fbd5a0b8da7b1d75aab621a10cfea250a62a49fd (patch) | |
tree | ed4a6532dc9650e8079228544b317b18eaa4095b /winsup/cygwin/times.cc | |
parent | 81223d017f09f34680f80df398d19165ab372525 (diff) |
* times.cc (hires_ms::usecs): Reinit timer when system time overflows.
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r-- | winsup/cygwin/times.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index 635d05a37..0674122b1 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -658,6 +658,12 @@ hires_ms::usecs (bool justdelta) if (!minperiod) /* NO_COPY variable */ prime (); DWORD now = timeGetTime (); + if (now <= initime_ms) + { + inited = 0; + prime (); + now = timeGetTime (); + } // FIXME: Not sure how this will handle the 49.71 day wrap around LONGLONG res = initime_us.QuadPart + ((LONGLONG) (now - initime_ms) * 1000); return res; |