diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-10-12 15:51:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-12 15:51:56 (GMT) |
commit | cba9a0c6def70549046f1afa6a80e38fe706520e (patch) | |
tree | 1700dda3a2a2170cc5d0766387fe6f020540c44c /Include | |
parent | 0e61e67a57deb4abc677808201d7cf3c38138e02 (diff) | |
download | cpython-cba9a0c6def70549046f1afa6a80e38fe706520e.zip cpython-cba9a0c6def70549046f1afa6a80e38fe706520e.tar.gz cpython-cba9a0c6def70549046f1afa6a80e38fe706520e.tar.bz2 |
bpo-31773: time.perf_counter() uses again double (GH-3964)
time.clock() and time.perf_counter() now use again C double
internally.
Remove also _PyTime_GetWinPerfCounterWithInfo(): use
_PyTime_GetPerfCounterDoubleWithInfo() instead on Windows.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pytime.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Include/pytime.h b/Include/pytime.h index 95d482f..fd95045 100644 --- a/Include/pytime.h +++ b/Include/pytime.h @@ -192,20 +192,21 @@ PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm); Return 0 on success, raise an exception and return -1 on error. */ PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm); -#ifdef MS_WINDOWS -PyAPI_FUNC(int) _PyTime_GetWinPerfCounterWithInfo( - _PyTime_t *t, - _Py_clock_info_t *info); -#endif +/* Get the performance counter: clock with the highest available resolution to + measure a short duration. + + The function cannot fail. _PyTime_Init() ensures that the system clock + works. */ +PyAPI_FUNC(double) _PyTime_GetPerfCounterDouble(void); /* Get the performance counter: clock with the highest available resolution to - measure a short duration. */ -PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void); + measure a short duration. -/* Similar to _PyTime_GetPerfCounter(), - but get also clock info if info is non-NULL. */ -PyAPI_FUNC(int) _PyTime_GetPerfCounterWithInfo( - _PyTime_t *t, + Fill info (if set) with information of the function used to get the time. + + Return 0 on success, raise an exception and return -1 on error. */ +PyAPI_FUNC(int) _PyTime_GetPerfCounterDoubleWithInfo( + double *t, _Py_clock_info_t *info); #ifdef __cplusplus |