mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
sched: provide low-precision monotonic time
Measure the interval since the start in order to provide a monotonic time for periodical tasks not using timers like driftfile updates, key refresh, etc. Return the interval in the double format, but keep an integer remainder limiting the precision to 0.01 second to avoid issues with very small increments in a long-running process.
This commit is contained in:
3
sched.h
3
sched.h
@@ -65,6 +65,9 @@ extern void SCH_SetFileHandlerEvent(int fd, int event, int enable);
|
||||
/* Get the time stamp taken after a file descriptor became ready or a timeout expired */
|
||||
extern void SCH_GetLastEventTime(struct timespec *cooked, double *err, struct timespec *raw);
|
||||
|
||||
/* Get a low-precision monotonic timestamp (starting at 0.0) */
|
||||
extern double SCH_GetLastEventMonoTime(void);
|
||||
|
||||
/* This queues a timeout to elapse at a given (raw) local time */
|
||||
extern SCH_TimeoutID SCH_AddTimeout(struct timespec *ts, SCH_TimeoutHandler handler, SCH_ArbitraryArgument arg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user