The default timer unit was incorrectly measured in milliseconds instead
authorArmin Rigo <arigo@tunes.org>
Fri, 10 Feb 2006 13:19:53 +0000 (13:19 +0000)
committerArmin Rigo <arigo@tunes.org>
Fri, 10 Feb 2006 13:19:53 +0000 (13:19 +0000)
of seconds, producing numbers 1000 times too large.  It would be nice to
write a test for this, but how...  (thanks mwh)

Modules/_lsprof.c

index 81d88eac57a4a033c5638240cb4eb59b09821b75..8b74e388815ff5e7def31e545b4223c11bff26b2 100644 (file)
@@ -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 */