Monado OpenXR Runtime
|
Time-keeping: a clock that is steady, convertible to system time, and ideally high-resolution. More...
Go to the source code of this file.
Macros | |
#define | U_1_000_000_000 (1000 * 1000 * 1000) |
Helper define to make code more readable. More... | |
#define | U_TIME_1S_IN_NS U_1_000_000_000 |
The number of nanoseconds in a second. More... | |
#define | U_TIME_1MS_IN_NS (1000 * 1000) |
The number of nanoseconds in a millisecond. More... | |
#define | U_TIME_HALF_MS_IN_NS (U_TIME_1MS_IN_NS / 2) |
The number of nanoseconds in half a millisecond. More... | |
Typedefs | |
typedef int64_t | timepoint_ns |
Integer timestamp type. More... | |
typedef int64_t | time_duration_ns |
Integer duration type in nanoseconds. More... | |
Functions | |
static double | time_ns_to_s (time_duration_ns ns) |
Convert nanoseconds duration to double seconds. More... | |
static time_duration_ns | time_s_to_ns (double duration) |
Convert float seconds to nanoseconds. More... | |
static double | time_ns_to_ms_f (time_duration_ns ns) |
Convert nanoseconds to double float milliseconds, useful for printing. More... | |
static timepoint_ns | time_ms_f_to_ns (double ms_f) |
Convert double float milliseconds to nanoseconds, human comprehensible config inputs. More... | |
static bool | time_is_within_range_of_each_other (timepoint_ns a, timepoint_ns b, int64_t range) |
Checks if two timepoints are with a certain range of each other. More... | |
static bool | time_is_within_half_ms (timepoint_ns a, timepoint_ns b) |
Checks if two timepoints are with half a millisecond of each other. More... | |
static bool | time_is_less_then_or_within_range (timepoint_ns a, timepoint_ns b, int64_t range) |
Fuzzy comparisons. More... | |
static bool | time_is_less_then_or_within_half_ms (timepoint_ns a, timepoint_ns b) |
Fuzzy comparisons. More... | |
static bool | time_is_greater_then_or_within_range (timepoint_ns a, timepoint_ns b, int64_t range) |
Fuzzy comparisons. More... | |
static bool | time_is_greater_then_or_within_half_ms (timepoint_ns a, timepoint_ns b) |
Fuzzy comparisons. More... | |
Time-keeping: a clock that is steady, convertible to system time, and ideally high-resolution.
Designed to suit the needs of OpenXR: you can and should use something simpler (like Portable Timekeeping) for most purposes that aren't in OpenXR interface code.
#define U_1_000_000_000 (1000 * 1000 * 1000) |
Helper define to make code more readable.
#define U_TIME_1MS_IN_NS (1000 * 1000) |
The number of nanoseconds in a millisecond.
#define U_TIME_1S_IN_NS U_1_000_000_000 |
The number of nanoseconds in a second.
#define U_TIME_HALF_MS_IN_NS (U_TIME_1MS_IN_NS / 2) |
The number of nanoseconds in half a millisecond.