Monado OpenXR Runtime
Portable Timekeeping

Unifying wrapper around system time retrieval functions. More...

Collaboration diagram for Portable Timekeeping:

Modules

 Extra Timekeeping Utilities
 Less-portable utility functions for manipulating system time, for interoperation with platform APIs.
 

Functions

static uint64_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_ns_per_qpc_tick_get (void)
 Return a qpc freq in nanoseconds. More...
 

Detailed Description

Unifying wrapper around system time retrieval functions.

Function Documentation

◆ os_monotonic_get_ns()

◆ os_nanosleep()

static void os_nanosleep ( int64_t  nsec)
inlinestatic

#include <auxiliary/os/os_time.h>

Sleep the given number of nanoseconds.

Note that on some platforms, this may be somewhat less accurate than you might want. On all platforms, the system scheduler has the final say.

See also
os_precise_sleeper

References U_1_000_000_000, and U_TIME_1MS_IN_NS.

Referenced by add_connected_devices(), and os_precise_sleeper::os_precise_sleeper_nanosleep().

◆ os_ns_per_qpc_tick_get()

static int64_t os_ns_per_qpc_tick_get ( void  )
inlinestatic

#include <auxiliary/os/os_time.h>

Return a qpc freq in nanoseconds.

Referenced by os_monotonic_get_ns().