Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(270)

Unified Diff: Include/pytime.h

Issue 22043: Use a monotonic clock to compute timeouts
Patch Set: Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Doc/library/time.rst ('k') | Lib/queue.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Include/pytime.h Sun Aug 31 14:47:56 2014 +0200
+++ b/Include/pytime.h Sun Aug 31 15:02:13 2014 +0200
@@ -93,6 +93,24 @@ PyAPI_FUNC(int) _PyTime_ObjectToTimespec
long *nsec,
_PyTime_round_t);
+/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
+ The clock is not affected by system clock updates. The reference point of
+ the returned value is undefined, so that only the difference between the
+ results of consecutive calls is valid.
+
+ The function never fails. _PyTime_Init() ensures that a monotonic clock
+ is available and works. */
+PyAPI_FUNC(void) _PyTime_monotonic(
+ _PyTime_timeval *tp);
+
+/* Similar to _PyTime_monotonic(), fill also 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_monotonic_info(
+ _PyTime_timeval *tp,
+ _Py_clock_info_t *info);
+
/* Initialize time.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int) _PyTime_Init(void);
« no previous file with comments | « Doc/library/time.rst ('k') | Lib/queue.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7