[issue31803] time.clock() should emit a DeprecationWarning

Marc-Andre Lemburg report at bugs.python.org
Tue Oct 24 16:40:58 EDT 2017


Marc-Andre Lemburg <mal at egenix.com> added the comment:

On 24.10.2017 11:23, STINNER Victor wrote:
> 
> Marc-Andre Lemburg: "Thanks for pointing that out. I didn't know."
> 
> Do you still think that we need to modify time.clock() rather than deprecating it?

Yes, to avoid yet another Python 2/3 difference. It should be
replaced with the appropriate variant on Windows
and non-Windows platforms. From Serhiy's response that's
time.process_time() on non-Windows platforms and time.perf_counter()
on Windows.

The documentation can point to the new functions and recommend
these over time.clock().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31803>
_______________________________________


More information about the Python-bugs-list mailing list