Monado OpenXR Runtime
Extra Timekeeping Utilities

Less-portable utility functions for manipulating system time, for interoperation with platform APIs. More...

Collaboration diagram for Extra Timekeeping Utilities:

Functions

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...
 

Detailed Description

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

Function Documentation

◆ os_ns_to_timespec()

static void os_ns_to_timespec ( int64_t  ns,
struct timespec *  spec 
)
inlinestatic

#include <auxiliary/os/os_time.h>

Convert an nanosecond integer to a timespec struct.

Note that this only does the value splitting, no adjustment for epochs is performed.

References U_1_000_000_000.

Referenced by os_semaphore::os_semaphore_get_realtime_clock().

◆ os_realtime_get_ns()

static int64_t os_realtime_get_ns ( void  )
inlinestatic

#include <auxiliary/os/os_time.h>

Return a realtime clock in nanoseconds (Linux-only)

References os_timespec_to_ns().

Referenced by euroc_recorder_start(), get_frame_monotonic_ts(), and process_frame().

◆ os_timespec_to_ns()

static int64_t os_timespec_to_ns ( const struct timespec *  spec)
inlinestatic

#include <auxiliary/os/os_time.h>

Convert a timespec struct to nanoseconds.

Note that this only does the value combining, no adjustment for epochs is performed.

References U_1_000_000_000.

Referenced by os_monotonic_get_ns(), os_realtime_get_ns(), and os_semaphore::os_semaphore_get_realtime_clock().

◆ os_timeval_to_ns()

static int64_t os_timeval_to_ns ( struct timeval *  val)
inlinestatic

#include <auxiliary/os/os_time.h>

Convert a timeval struct to nanoseconds.

References U_1_000_000_000.