mirror of
https://github.com/python/cpython.git
synced 2025-01-21 07:55:16 +08:00
The default timer unit was incorrectly measured in milliseconds instead
of seconds, producing numbers 1000 times too large. It would be nice to write a test for this, but how... (thanks mwh)
This commit is contained in:
parent
b4549c4a7e
commit
2bc23f512d
@ -27,9 +27,9 @@ hpTimerUnit(void)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
if (QueryPerformanceFrequency(&li))
|
||||
return 1000.0 / li.QuadPart;
|
||||
return 1.0 / li.QuadPart;
|
||||
else
|
||||
return 0.001; /* unlikely */
|
||||
return 0.000001; /* unlikely */
|
||||
}
|
||||
|
||||
#else /* !MS_WINDOWS */
|
||||
@ -63,7 +63,7 @@ hpTimer(void)
|
||||
static double
|
||||
hpTimerUnit(void)
|
||||
{
|
||||
return 0.001;
|
||||
return 0.000001;
|
||||
}
|
||||
|
||||
#endif /* MS_WINDOWS */
|
||||
|
Loading…
Reference in New Issue
Block a user