Functions for converting between time units and external time formats.
◆ timeFromAbsTimespec()
| int64 timeFromAbsTimespec |
( |
struct timespec * |
ts | ) |
|
|
inline |
Convert a Unix absolute timespec to Julian epoch time.
Converts a POSIX timespec structure representing an absolute timestamp (seconds since Unix epoch: Jan 1, 1970) to microseconds since Julian epoch.
Unix epoch (Jan 1, 1970 00:00:00 UTC) corresponds to Julian date 2440587.50000, which is 210866760000000000 microseconds from the Julian epoch.
- Parameters
-
| ts | Pointer to timespec structure with Unix epoch timestamp |
- Returns
- Time value in microseconds since Julian epoch
Definition at line 178 of file time.h.
◆ timeFromMsec()
| int64 timeFromMsec |
( |
int64 |
msec | ) |
|
|
inline |
Convert milliseconds to microseconds.
- Parameters
-
| msec | Time value in milliseconds |
- Returns
- Time value in microseconds
Definition at line 136 of file time.h.
◆ timeFromRelTimespec()
| int64 timeFromRelTimespec |
( |
struct timespec * |
ts | ) |
|
|
inline |
Convert a relative timespec to microseconds.
Converts a POSIX timespec structure representing a relative time interval (not an absolute timestamp) to microseconds.
- Parameters
-
| ts | Pointer to timespec structure |
- Returns
- Time interval in microseconds
Definition at line 148 of file time.h.
◆ timeFromSeconds()
| int64 timeFromSeconds |
( |
int64 |
seconds | ) |
|
|
inline |
Convert seconds to microseconds.
- Parameters
-
| seconds | Time value in seconds |
- Returns
- Time value in microseconds
Definition at line 120 of file time.h.
◆ timeFromTimeT()
| int64 timeFromTimeT |
( |
time_t |
tt | ) |
|
|
inline |
Convert a Unix time_t to Julian epoch time.
Converts a standard C time_t value (seconds since Unix epoch: Jan 1, 1970) to microseconds since Julian epoch.
- Parameters
-
- Returns
- Time value in microseconds since Julian epoch
Definition at line 216 of file time.h.
◆ timeToAbsTimespec()
| void timeToAbsTimespec |
( |
struct timespec * |
ts, |
|
|
int64 |
time |
|
) |
| |
|
inline |
Convert Julian epoch time to a Unix absolute timespec.
Converts a time value in microseconds since Julian epoch to a POSIX timespec structure representing seconds since Unix epoch (Jan 1, 1970).
- Parameters
-
| ts | Pointer to timespec structure to populate |
| time | Time value in microseconds since Julian epoch |
Definition at line 201 of file time.h.
◆ timeToMsec()
| int64 timeToMsec |
( |
int64 |
time | ) |
|
|
inline |
Convert microseconds to milliseconds (truncating).
- Parameters
-
| time | Time value in microseconds |
- Returns
- Time value in milliseconds
Definition at line 128 of file time.h.
◆ timeToRelTimespec()
| void timeToRelTimespec |
( |
struct timespec * |
ts, |
|
|
int64 |
time |
|
) |
| |
|
inline |
Convert microseconds to a relative timespec.
Converts a time interval in microseconds to a POSIX timespec structure representing a relative time (not an absolute timestamp).
- Parameters
-
| ts | Pointer to timespec structure to populate |
| time | Time interval in microseconds |
Definition at line 162 of file time.h.
◆ timeToSeconds()
| int64 timeToSeconds |
( |
int64 |
time | ) |
|
|
inline |
Convert microseconds to seconds (truncating).
- Parameters
-
| time | Time value in microseconds |
- Returns
- Time value in seconds
Definition at line 112 of file time.h.
◆ timeToTimeT()
| time_t timeToTimeT |
( |
int64 |
time | ) |
|
|
inline |
Convert Julian epoch time to a Unix time_t.
Converts a time value in microseconds since Julian epoch to a standard C time_t value (seconds since Unix epoch).
- Parameters
-
| time | Time value in microseconds since Julian epoch |
- Returns
- time_t value (seconds since Unix epoch)
Definition at line 230 of file time.h.