diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-09-02 22:15:23 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-09-02 22:15:23 (GMT) |
commit | 5a682c9ca5b5f0ea3e2d5e2b02fc1a5304c501a2 (patch) | |
tree | 07f7a09a23104c1c19f91c108cacd75d7020e99e /Python/pytime.c | |
parent | 40e47f69b7a7d49b90ed34cfc11b6b7739b7e38f (diff) | |
parent | 5ad5821d0960994b0cdf3ed451de48e5b2490704 (diff) | |
download | cpython-5a682c9ca5b5f0ea3e2d5e2b02fc1a5304c501a2.zip cpython-5a682c9ca5b5f0ea3e2d5e2b02fc1a5304c501a2.tar.gz cpython-5a682c9ca5b5f0ea3e2d5e2b02fc1a5304c501a2.tar.bz2 |
Merge 3.5 (monotonic)
Diffstat (limited to 'Python/pytime.c')
-rw-r--r-- | Python/pytime.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Python/pytime.c b/Python/pytime.c index 02a1edf..8166cec 100644 --- a/Python/pytime.c +++ b/Python/pytime.c @@ -601,12 +601,8 @@ _PyTime_GetSystemClockWithInfo(_PyTime_t *t, _Py_clock_info_t *info) static int -pymonotonic_new(_PyTime_t *tp, _Py_clock_info_t *info, int raise) +pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise) { -#ifdef Py_DEBUG - static int last_set = 0; - static _PyTime_t last = 0; -#endif #if defined(MS_WINDOWS) ULONGLONG result; @@ -698,12 +694,6 @@ pymonotonic_new(_PyTime_t *tp, _Py_clock_info_t *info, int raise) if (_PyTime_FromTimespec(tp, &ts, raise) < 0) return -1; #endif -#ifdef Py_DEBUG - /* monotonic clock cannot go backward */ - assert(!last_set || last <= *tp); - last = *tp; - last_set = 1; -#endif return 0; } @@ -711,7 +701,7 @@ _PyTime_t _PyTime_GetMonotonicClock(void) { _PyTime_t t; - if (pymonotonic_new(&t, NULL, 0) < 0) { + if (pymonotonic(&t, NULL, 0) < 0) { /* should not happen, _PyTime_Init() checked that monotonic clock at startup */ assert(0); @@ -725,7 +715,7 @@ _PyTime_GetMonotonicClock(void) int _PyTime_GetMonotonicClockWithInfo(_PyTime_t *tp, _Py_clock_info_t *info) { - return pymonotonic_new(tp, info, 1); + return pymonotonic(tp, info, 1); } int |