Kaydet (Commit) 7b1be36b authored tarafından Georg Brandl's avatar Georg Brandl

In Windows' time.clock(), when QueryPerformanceFrequency() fails,

the C lib's clock() is used, but it must be divided by CLOCKS_PER_SEC
as for the POSIX implementation (thanks to #pypy).
 (backport from rev. 54606)
üst 65245739
......@@ -175,7 +175,8 @@ time_clock(PyObject *self, PyObject *unused)
if (!QueryPerformanceFrequency(&freq) || freq.QuadPart == 0) {
/* Unlikely to happen - this works on all intel
machines at least! Revert to clock() */
return PyFloat_FromDouble(clock());
return PyFloat_FromDouble(((double)clock()) /
CLOCKS_PER_SEC);
}
divisor = (double)freq.QuadPart;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment