STINNER Victor <victor.stin...@gmail.com> added the comment:

I misunderstood the time.clock() function. It counts the CPU time while the 
process is active, whereas a monotonic clock counts elapsed time even during a 
sleep. time.clock() and time.monotonic() are different clocks for different 
purposes.

I wrote the PEP 418 which contains a list of all available OS clocks. It lists 
monotonic clocks, but also "process time" and "thread time" clocks. And it has 
a "Deferred API: time.perf_counter()" section.

Something can be done to provide portable functions to get the user and system 
times. See for example Tools/pybench/systimes.py written by Marc-Andre Lemburg.

Python 3.3 gives access to clock_gettime(CLOCK_PROCESS_CPUTIME_ID) and 
clock_gettime(CLOCK_THREAD_CPUTIME_ID).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14309>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to