Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a682c9

Browse files
committed
Merge 3.5 (monotonic)
2 parents 40e47f6 + 5ad5821 commit 5a682c9

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

Python/pytime.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -601,12 +601,8 @@ _PyTime_GetSystemClockWithInfo(_PyTime_t *t, _Py_clock_info_t *info)
601601

602602

603603
static int
604-
pymonotonic_new(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
604+
pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
605605
{
606-
#ifdef Py_DEBUG
607-
static int last_set = 0;
608-
static _PyTime_t last = 0;
609-
#endif
610606
#if defined(MS_WINDOWS)
611607
ULONGLONG result;
612608

@@ -697,12 +693,6 @@ pymonotonic_new(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
697693
}
698694
if (_PyTime_FromTimespec(tp, &ts, raise) < 0)
699695
return -1;
700-
#endif
701-
#ifdef Py_DEBUG
702-
/* monotonic clock cannot go backward */
703-
assert(!last_set || last <= *tp);
704-
last = *tp;
705-
last_set = 1;
706696
#endif
707697
return 0;
708698
}
@@ -711,7 +701,7 @@ _PyTime_t
711701
_PyTime_GetMonotonicClock(void)
712702
{
713703
_PyTime_t t;
714-
if (pymonotonic_new(&t, NULL, 0) < 0) {
704+
if (pymonotonic(&t, NULL, 0) < 0) {
715705
/* should not happen, _PyTime_Init() checked that monotonic clock at
716706
startup */
717707
assert(0);
@@ -725,7 +715,7 @@ _PyTime_GetMonotonicClock(void)
725715
int
726716
_PyTime_GetMonotonicClockWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
727717
{
728-
return pymonotonic_new(tp, info, 1);
718+
return pymonotonic(tp, info, 1);
729719
}
730720

731721
int

0 commit comments

Comments
 (0)