summaryrefslogtreecommitdiff
path: root/Modules/_lsprof.c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2006-02-10 13:19:53 +0000
committerArmin Rigo <arigo@tunes.org>2006-02-10 13:19:53 +0000
commita9bda6a89e8b15734686ff5f710a2135bd6c8098 (patch)
treeb514e50c51628d2d09058464932ab98979e1623d /Modules/_lsprof.c
parent51c039dac1ee0dbf7cdd800ac8b3a31912b837c6 (diff)
downloadcpython-a9bda6a89e8b15734686ff5f710a2135bd6c8098.tar.gz
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)
Diffstat (limited to 'Modules/_lsprof.c')
-rw-r--r--Modules/_lsprof.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 81d88eac57..8b74e38881 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 */