Marc-Andre Lemburg <[email protected]> added the comment:
On 25.10.2017 01:31, STINNER Victor wrote:
>
> 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()?
What I meant is that time.clock() is replaced with the higher
accuracy timers corresponding to the current time.clock()
implementation on the various platforms in order to retain
backwards compatibility.
In other words:
if sys.platform == 'win32':
time.clock = time.perf_counter
else:
time.clock = time.process_time
I know that time.clock() behaves differently on different platforms,
but this fact has been known for a long time and is being used by
Python code out there for timing purposes.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31803>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com