消息 [304948]
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." |
|
| 日期 |
用户 |
动作 |
参数 |
| 2017-10-24 23:31:55 | vstinner | 修改 | recipients:
+ vstinner, lemburg, fdrake, belopolsky, benjamin.peterson, mrabarnett, benhoyt, ethan.furman, serhiy.storchaka |
| 2017-10-24 23:31:55 | vstinner | 修改 | messageid: <1508887915.05.0.213398074469.issue31803@psf.upfronthosting.co.za> |
| 2017-10-24 23:31:55 | vstinner | 链接 | issue31803 messages |
| 2017-10-24 23:31:55 | vstinner | 创建 | |
|