* times.cc (hires_ms::usecs): Reinit timer when system time overflows.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user