This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients belopolsky, benhoyt, benjamin.peterson, ethan.furman, fdrake, lemburg, mrabarnett, serhiy.storchaka, vstinner
Date 2017-10-24.23:31:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Marc-Andre: "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."

I don't understand why you mean by "replaced with". Do you mean modify the implementation of the time.clock()?

I would like to kill time.clock() beceause it behaves differently on Windows and non-Windows platforms. There are two choices:

* deprecate time.clock() and later remove time.clock() -- it's deprecated since Python 3.3, and Python 3.7 now emits a DeprecationWarning
* modify time.clock() to get the same behaviour on all platforms: I proposed to modify time.clock() to become a simple alias to time.perf_counter()

Now I'm confused. I'm not sure that I understood what you suggest.

Note: time.clock() already behaves like time.perf_counter() on Windows and time.process_time() on non-Windows. It's exactly how it's implemented. But I consider that it's a bug, and I want to fix it.

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

It's already done in the doc since Python 3.3, no?

"Deprecated since version 3.3: The behaviour of this function depends on the platform: use perf_counter() or process_time() instead, depending on your requirements, to have a well defined behaviour."
Date User Action Args
2017-10-24 23:31:55vstinnersetrecipients: + vstinner, lemburg, fdrake, belopolsky, benjamin.peterson, mrabarnett, benhoyt, ethan.furman, serhiy.storchaka
2017-10-24 23:31:55vstinnersetmessageid: <>
2017-10-24 23:31:55vstinnerlinkissue31803 messages
2017-10-24 23:31:55vstinnercreate