summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2006-02-10 13:19:53 (GMT)
committerArmin Rigo <arigo@tunes.org>2006-02-10 13:19:53 (GMT)
commit2bc23f512dd38717092f4642aa9b3d63705e9836 (patch)
treed8f0a9a67ae68d700b546490ef62c39e5c37e4d1
parentb4549c4a7e8586a8f43c7bd573fd5bd255467677 (diff)
downloadcpython-2bc23f512dd38717092f4642aa9b3d63705e9836.zip
cpython-2bc23f512dd38717092f4642aa9b3d63705e9836.tar.gz
cpython-2bc23f512dd38717092f4642aa9b3d63705e9836.tar.bz2
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)
-rw-r--r--Modules/_lsprof.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 81d88ea..8b74e38 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -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 */