[issue13481] Use an accurate clock in timeit

Charles-François Natali report at bugs.python.org
Sat Nov 26 12:12:41 CET 2011


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

> Indeed. I thought CPU time would be more useful (and that's the point
> of the patch)

Ah, OK.
Then you should probably rename the issue "make timeit measure CPU time", or something like that, because I really thought this issue was about using a more accurate clock (less jitter, can't go backward, etc). And also update the documentation :-)

>  but perhaps it breaks the spec.

Well, I almost never use timeit so I can't make a call, but that's definitely a semantics change, and this may puzzle some users, especially since it will really depend on the OS/kernel version in use (and so it won't be documented).

> But does it include kernel CPU time for the given process?

Yes. But it won't be reliable, for example, to measure the performance of a new readinto() implentation, since time spent by the process in 'S' or 'D' state won't be accounted for.

----------

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


More information about the Python-bugs-list mailing list