wall-time

Retrieve wall-time in Python using the standard library?

不羁岁月 提交于 2019-12-07 02:18:27
问题 How can I retrieve wall-time in Python using the standard library? This question, and this question would suggest that something like clock_gettime(CLOCK_MONOTONIC_RAW) or /proc/uptime are most appropriate on Linux. On Windows, time.clock() has the desired effect. I would use time.time(), but the function is not guaranteed to return monotonically (and linearly) increasing time values. 回答1: Victor Stinner wrote a Python implementation of a monotonic timer. See http://bugs.python.org/issue10278

Retrieve wall-time in Python using the standard library?

我的梦境 提交于 2019-12-05 04:31:30
How can I retrieve wall-time in Python using the standard library? This question, and this question would suggest that something like clock_gettime(CLOCK_MONOTONIC_RAW) or /proc/uptime are most appropriate on Linux. On Windows, time.clock() has the desired effect. I would use time.time() , but the function is not guaranteed to return monotonically (and linearly) increasing time values. Victor Stinner wrote a Python implementation of a monotonic timer . See http://bugs.python.org/issue10278 for the discussion and the docs for the upcoming 3.3 release referencing the new feature (coded in C).