@@ -62,7 +62,6 @@ extern "C" {
6262struct timeval ;
6363#endif
6464
65- typedef PyTime_t PyTime_t ;
6665#define _SIZEOF_PYTIME_T 8
6766
6867typedef enum {
@@ -253,37 +252,28 @@ typedef struct {
253252 double resolution ;
254253} _Py_clock_info_t ;
255254
256- // Get the current time from the system clock.
257- //
258- // If the internal clock fails, silently ignore the error and return 0.
259- // On integer overflow, silently ignore the overflow and clamp the clock to
260- // [_PyTime_MIN; _PyTime_MAX].
255+ // Similar to PyTime_Time() but silently ignore the error and return 0 if the
256+ // internal clock fails.
261257//
262- // Use _PyTime_GetSystemClockWithInfo or the public PyTime_Time() to check
258+ // Use _PyTime_TimeWithInfo() or the public PyTime_Time() to check
263259// for failure.
264260// Export for '_random' shared extension.
265- PyAPI_FUNC (PyTime_t ) _PyTime_GetSystemClock (void );
261+ PyAPI_FUNC (PyTime_t ) _PyTime_TimeUnchecked (void );
266262
267263// Get the current time from the system clock.
268264// On success, set *t and *info (if not NULL), and return 0.
269265// On error, raise an exception and return -1.
270- extern int _PyTime_GetSystemClockWithInfo (
266+ extern int _PyTime_TimeWithInfo (
271267 PyTime_t * t ,
272268 _Py_clock_info_t * info );
273269
274- // Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
275- // The clock is not affected by system clock updates. The reference point of
276- // the returned value is undefined, so that only the difference between the
277- // results of consecutive calls is valid.
270+ // Similar to PyTime_Monotonic() but silently ignore the error and return 0 if
271+ // the internal clock fails.
278272//
279- // If the internal clock fails, silently ignore the error and return 0.
280- // On integer overflow, silently ignore the overflow and clamp the clock to
281- // [_PyTime_MIN; _PyTime_MAX].
282- //
283- // Use _PyTime_GetMonotonicClockWithInfo or the public PyTime_Monotonic()
273+ // Use _PyTime_MonotonicWithInfo() or the public PyTime_Monotonic()
284274// to check for failure.
285275// Export for '_random' shared extension.
286- PyAPI_FUNC (PyTime_t ) _PyTime_GetMonotonicClock (void );
276+ PyAPI_FUNC (PyTime_t ) _PyTime_MonotonicUnchecked (void );
287277
288278// Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
289279// The clock is not affected by system clock updates. The reference point of
@@ -294,7 +284,7 @@ PyAPI_FUNC(PyTime_t) _PyTime_GetMonotonicClock(void);
294284//
295285// Return 0 on success, raise an exception and return -1 on error.
296286// Export for '_testsinglephase' shared extension.
297- PyAPI_FUNC (int ) _PyTime_GetMonotonicClockWithInfo (
287+ PyAPI_FUNC (int ) _PyTime_MonotonicWithInfo (
298288 PyTime_t * t ,
299289 _Py_clock_info_t * info );
300290
@@ -309,17 +299,13 @@ PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
309299// Export for '_datetime' shared extension.
310300PyAPI_FUNC (int ) _PyTime_gmtime (time_t t , struct tm * tm );
311301
312- // Get the performance counter: clock with the highest available resolution to
313- // measure a short duration .
302+ // Similar to PyTime_PerfCounter() but silently ignore the error and return 0
303+ // if the internal clock fails .
314304//
315- // If the internal clock fails, silently ignore the error and return 0.
316- // On integer overflow, silently ignore the overflow and clamp the clock to
317- // [_PyTime_MIN; _PyTime_MAX].
318- //
319- // Use _PyTime_GetPerfCounterWithInfo() or the public PyTime_PerfCounter
320- // to check for failure.
305+ // Use _PyTime_PerfCounterWithInfo() or the public PyTime_PerfCounter() to
306+ // check for failure.
321307// Export for '_lsprof' shared extension.
322- PyAPI_FUNC (PyTime_t ) _PyTime_GetPerfCounter (void );
308+ PyAPI_FUNC (PyTime_t ) _PyTime_PerfCounterUnchecked (void );
323309
324310
325311// Get the performance counter: clock with the highest available resolution to
@@ -328,7 +314,7 @@ PyAPI_FUNC(PyTime_t) _PyTime_GetPerfCounter(void);
328314// Fill info (if set) with information of the function used to get the time.
329315//
330316// Return 0 on success, raise an exception and return -1 on error.
331- extern int _PyTime_GetPerfCounterWithInfo (
317+ extern int _PyTime_PerfCounterWithInfo (
332318 PyTime_t * t ,
333319 _Py_clock_info_t * info );
334320
@@ -341,12 +327,12 @@ extern int _PyTime_GetPerfCounterWithInfo(
341327// --- _PyDeadline -----------------------------------------------------------
342328
343329// Create a deadline.
344- // Pseudo code: _PyTime_GetMonotonicClock () + timeout.
330+ // Pseudo code: _PyTime_MonotonicUnchecked () + timeout.
345331// Export for '_ssl' shared extension.
346332PyAPI_FUNC (PyTime_t ) _PyDeadline_Init (PyTime_t timeout );
347333
348334// Get remaining time from a deadline.
349- // Pseudo code: deadline - _PyTime_GetMonotonicClock ().
335+ // Pseudo code: deadline - _PyTime_MonotonicUnchecked ().
350336// Export for '_ssl' shared extension.
351337PyAPI_FUNC (PyTime_t ) _PyDeadline_Get (PyTime_t deadline );
352338
0 commit comments