Restore wall time in Python using standard library?

How can I get wall-time in Python using the standard library?

This question, and this question suggests that something like clock_gettime(CLOCK_MONOTONIC_RAW) or /proc/uptime most suitable for Linux. On Windows, time.clock() has the desired effect.

I would use time.time() , but the function does not guarantee a monotonous (and linear) return by increasing the time values.

+7
python time standard-library clock
Jan 14 2018-11-11T00:
source share
1 answer

Victor Steiner wrote a Python monotone timer implementation . See http://bugs.python.org/issue10278 for a discussion and documents for the upcoming version 3.3 link to a new feature (C encoded).

There is also Monoclock :

Monoclock is a Python module that provides access to monotonous clocks on POSIX-like operating systems that have librt .

Compatibility: tested on CPython 2.6.5, CPython 2.7, pypy 1.3, and pypy 1.4.

+6
Jan 14 2018-11-11T00:
source share



All Articles