Monado OpenXR Runtime
Loading...
Searching...
No Matches
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 int64_t os_monotonic_get_ns (void)
 Return a monotonic clock in nanoseconds.
 
static void os_nanosleep (int64_t nsec)
 Sleep the given number of nanoseconds.
 
static int64_t os_ns_per_qpc_tick_get (void)
 Return a qpc freq in nanoseconds.
 

Detailed Description

Unifying wrapper around system time retrieval functions.

Function Documentation

◆ os_monotonic_get_ns()

static int64_t os_monotonic_get_ns ( void  )
inlinestatic

#include <auxiliary/os/os_time.h>

Return a monotonic clock in nanoseconds.

References os_ns_per_qpc_tick_get(), and os_timespec_to_ns().

Referenced by add_connected_devices(), CDeviceDriver_Monado::CDeviceDriver_Monado(), xrt_system_compositor::comp_main_create_system_compositor(), multi_system_compositor::comp_multi_create_system_compositor(), comp_renderer::comp_renderer_draw(), correspondence_search_find_one_pose(), daydream_run_thread(), feeder::feeder_send_feedback(), get_frame_monotonic_ts(), CDeviceDriver_Monado_Controller::GetPose(), CDeviceDriver_Monado::GetPose(), hydra_system_update(), leap_input_loop(), multi_compositor_layer_commit(), ns_hmd_create(), oh_device_get_tracked_pose(), xrt::tracking::hand::mercury::lm::opt_run(), os_fd_read(), os_monotonic_get_ts(), oxr_session_frame_end(), oxr_session_request_exit(), xrt::state_trackers::openvr::Events::pollEvent(), process_frame(), qwerty_controller::qwerty_press_menu(), qwerty_controller::qwerty_press_squeeze(), qwerty_controller::qwerty_press_system(), qwerty_controller::qwerty_press_trigger(), qwerty_controller::qwerty_release_menu(), qwerty_controller::qwerty_release_squeeze(), qwerty_controller::qwerty_release_system(), qwerty_controller::qwerty_release_trigger(), receive_frame(), sample_hmd_create(), simulated_hmd_create(), slot_clear_locked(), status_thread_runner(), svr_hmd_create(), t_slam_receive_imu(), time_state::time_state_get_now(), xrt::auxiliary::tracking::slam::timing_ui_push(), u_wait_until(), ulv2_create_device(), HmdDevice::update_inputs(), and vf_fs_frame().

◆ 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_TIME_1MS_IN_NS, and U_TIME_1S_IN_NS.

Referenced by add_connected_devices(), create_hmd(), leap_input_loop(), os_precise_sleeper::os_precise_sleeper_nanosleep(), read_calibration_data(), rift_devices_create(), rift_s_camera_create(), rift_sensor_ar0134_init(), ulv2_create_device(), and vp2_prepare_shutdown().

◆ 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().