STINNER Victor <victor.stin...@gmail.com> added the comment: 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? https://docs.python.org/dev/library/time.html#time.clock "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." ---------- _______________________________________ 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