diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-04-29 00:41:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-04-29 00:41:27 (GMT) |
commit | ec89539ccccd6103665a7a5c7234cf09f27c1c72 (patch) | |
tree | 5899bfa59a08ae9db3e630c2419ee87b4df6b101 /Include | |
parent | ca6e40f12a3145856abfe69d5cd8b97df6ebca95 (diff) | |
download | cpython-ec89539ccccd6103665a7a5c7234cf09f27c1c72.zip cpython-ec89539ccccd6103665a7a5c7234cf09f27c1c72.tar.gz cpython-ec89539ccccd6103665a7a5c7234cf09f27c1c72.tar.bz2 |
Issue #14428, #14397: Implement the PEP 418
* Rename time.steady() to time.monotonic()
* On Windows, time.monotonic() uses GetTickCount/GetTickCount64() instead of
QueryPerformanceCounter()
* time.monotonic() uses CLOCK_HIGHRES if available
* Add time.get_clock_info(), time.perf_counter() and time.process_time()
functions
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pytime.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Include/pytime.h b/Include/pytime.h index 221279b..a0cedb2 100644 --- a/Include/pytime.h +++ b/Include/pytime.h @@ -22,11 +22,25 @@ typedef struct { } _PyTime_timeval; #endif +/* Structure used by time.get_clock_info() */ +typedef struct { + const char *implementation; + int is_monotonic; + int is_adjusted; + double resolution; +} _Py_clock_info_t; + /* Similar to POSIX gettimeofday but cannot fail. If system gettimeofday * fails or is not available, fall back to lower resolution clocks. */ PyAPI_FUNC(void) _PyTime_gettimeofday(_PyTime_timeval *tp); +/* Similar to _PyTime_gettimeofday() but retrieve also information on the + * clock used to get the current time. */ +PyAPI_FUNC(void) _PyTime_gettimeofday_info( + _PyTime_timeval *tp, + _Py_clock_info_t *info); + #define _PyTime_ADD_SECONDS(tv, interval) \ do { \ tv.tv_usec += (long) (((long) interval - interval) * 1000000); \ |