Monado OpenXR Runtime
|
Wrapper around OS native time functions. More...
#include "xrt/xrt_config_os.h"
#include "xrt/xrt_compiler.h"
#include "util/u_time.h"
#include <time.h>
#include <sys/time.h>
Go to the source code of this file.
Data Structures | |
struct | os_precise_sleeper |
Macros | |
#define | XRT_HAVE_TIMESPEC |
#define | XRT_HAVE_TIMEVAL |
#define | OS_NS_PER_USEC (1000) |
Functions | |
static int64_t | os_monotonic_get_ns (void) |
Return a monotonic clock in nanoseconds. More... | |
static void | os_nanosleep (int64_t nsec) |
Sleep the given number of nanoseconds. More... | |
static int64_t | os_timespec_to_ns (const struct timespec *spec) |
Convert a timespec struct to nanoseconds. More... | |
static void | os_ns_to_timespec (int64_t ns, struct timespec *spec) |
Convert an nanosecond integer to a timespec struct. More... | |
static int64_t | os_timeval_to_ns (struct timeval *val) |
Convert a timeval struct to nanoseconds. More... | |
static int64_t | os_realtime_get_ns (void) |
Return a realtime clock in nanoseconds (Linux-only) More... | |
static int64_t | os_ns_per_qpc_tick_get (void) |
Return a qpc freq in nanoseconds. More... | |
static void | os_precise_sleeper_init (struct os_precise_sleeper *ops) |
static void | os_precise_sleeper_deinit (struct os_precise_sleeper *ops) |
static void | os_precise_sleeper_nanosleep (struct os_precise_sleeper *ops, int32_t nsec) |
Wrapper around OS native time functions.
These should be preferred over directly using native OS time functions in potentially-portable code. Additionally, in most cases these are preferred over timepoints from time_state for general usage in drivers, etc.