Various utility functions for handling times. More...
#include <limits.h>#include <isode/base/compat.h>Go to the source code of this file.
Data Structures | |
| class | Timecompare |
| Comparator class for times. More... | |
Functions | |
| bool | timespec_cmp (const struct timespec *time1, const struct timespec *time2) |
| Function for comparing two times. | |
| unsigned long | timespec_diff (const struct timespec *time1, const struct timespec *time2) |
| Function for getting the difference between two times. | |
| void | getNow (struct timespec &now) |
| Return the current time. | |
| void | addMillisecs (struct timespec &now, unsigned millisecs) |
| Add millisecs to a time. | |
Detailed Description
Various utility functions for handling times.
Definition in file timeutil.h.
Function Documentation
◆ timespec_cmp()
|
inline |
Function for comparing two times.
- Returns
- true if time1 preceeds time2
Definition at line 27 of file timeutil.h.
◆ timespec_diff()
|
inline |
Function for getting the difference between two times.
If time1 follows time2, then it returns the difference in microseconds capped at about ULONG_MAX microseconds (71 minutes for 32 bit ulong). If time1 preceeds time2, then the result is zero.
Definition at line 42 of file timeutil.h.
Referenced by Poll::Poll_select::Deliver().
◆ getNow()
|
inline |
Return the current time.
Definition at line 60 of file timeutil.h.
Referenced by Poll::Poll_select::Deliver().
◆ addMillisecs()
|
inline |
Add millisecs to a time.
Definition at line 70 of file timeutil.h.