[issue13481] Use an accurate clock in timeit

Charles-François Natali report at bugs.python.org
Tue Nov 29 09:22:09 CET 2011


Charles-François Natali <neologix at free.fr> added the comment:

> Are CLOCK_MONOTONIC_RAW, CLOCK_MONOTONIC and CLOCK_REALTIME more accurate than gettimeofday (time.time)?

Actually, on Linux gettimeofday() returns CLOCK_REALTIME.
As for CLOCK_MONOTONIC{_RAW}, they're guaranteed not to go backward
(NTP and such).
But I think Antoine was referring to CPU time vs wall clock time (but
see comments above while this is probably a bad idea).

> I think this should be rejected.

Agreed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13481>
_______________________________________


More information about the Python-bugs-list mailing list