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

Marc Andre Lemburg: "time.cock() is used in a lot of code. Why can't we simply 
replace the functionality with one of the other functions ? The documentation 
certainly allows for such a change, since it pretty much just says that only 
the delta between two values has a meaning."

Currently time.clock() is the same clock than time.perf_counter() on Windows, 
but it's closer to CPU time as time.process_time() on Unix.

time.perf_counter() and time.process_time() have a different name because the 
they are different clocks and don't measure the same thing. The main obvious 
difference is that time.process_time() doesn't include time elapsed during 
sleep.

>>> import time
>>> c1=time.perf_counter(); p1=time.process_time(); time.sleep(1); 
>>> c2=time.perf_counter(); p2=time.process_time()
>>> c2-c1, p2-p1
(1.0010841980038094, 7.308599999999998e-05)

I don't see how to modify clock() to make it behave the same on Windows and 
Unix without breaking any application which relies on the current clock() 
behaviour.

----------

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

Reply via email to