Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bc23f5

Browse files
committed
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)
1 parent b4549c4 commit 2bc23f5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/_lsprof.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ hpTimerUnit(void)
2727
{
2828
LARGE_INTEGER li;
2929
if (QueryPerformanceFrequency(&li))
30-
return 1000.0 / li.QuadPart;
30+
return 1.0 / li.QuadPart;
3131
else
32-
return 0.001; /* unlikely */
32+
return 0.000001; /* unlikely */
3333
}
3434

3535
#else /* !MS_WINDOWS */
@@ -63,7 +63,7 @@ hpTimer(void)
6363
static double
6464
hpTimerUnit(void)
6565
{
66-
return 0.001;
66+
return 0.000001;
6767
}
6868

6969
#endif /* MS_WINDOWS */

0 commit comments

Comments
 (0)