You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On UNIX, time.time() currently uses clock_gettime(), but _PyTime_gettimeofday() doesn't becauce pytime.c lacks a dependency on the librt module (needed on some platforms).
Attached patch adds the dependency if needed and modify _PyTime_gettimeofday() to use clock_gettime() if available.
The patch alone is not very useful. I wrote it to prepare the work for the issue bpo-22043 (use a monotonic clock in Python modules written in C).
With the patch, Python depends on the librt on Solaris and on Linux with glibc older than 2.17 (clock_gettime is now available directly in the libc since glibc 2.17).
Activity
vstinner commentedon Aug 27, 2014
On UNIX, time.time() currently uses clock_gettime(), but _PyTime_gettimeofday() doesn't becauce pytime.c lacks a dependency on the librt module (needed on some platforms).
Attached patch adds the dependency if needed and modify _PyTime_gettimeofday() to use clock_gettime() if available.
The patch alone is not very useful. I wrote it to prepare the work for the issue bpo-22043 (use a monotonic clock in Python modules written in C).
With the patch, Python depends on the librt on Solaris and on Linux with glibc older than 2.17 (clock_gettime is now available directly in the libc since glibc 2.17).
python-dev commentedon Aug 29, 2014
New changeset 8e13ad4e5ae6 by Victor Stinner in branch 'default':
Issue bpo-22287: On UNIX, _PyTime_gettimeofday() now uses
http://hg.python.org/cpython/rev/8e13ad4e5ae6