OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
osvr::util::time Namespace Reference

Functionality related to time and the OSVR_TimeValue abstraction.Note that this is for C API-bordering areas. For purely C++ code, please use std::chrono for your time needs. More...

Typedefs

typedef ::OSVR_TimeValue TimeValue
 C++-friendly typedef for the OSVR_TimeValue structure.
 

Functions

OSVR_ReturnCode microsleep (uint64_t microseconds)
 Request a thread sleep for at least the given number of microseconds. More...
 
void getNow (TimeValue &tv)
 Set the given TimeValue to the current time.
 
TimeValue getNow ()
 Get a TimeValue for the current time.
 
double duration (TimeValue const &a, TimeValue const &b)
 Get a double containing seconds between the time points. More...
 
std::string toDecimalString (TimeValue tv)
 Converts to a precise decimal string.
 
void toStructTimeval (struct timeval &dest, TimeValue const &src)
 Convert a TimeValue to a struct timeval.
 
void fromStructTimeval (TimeValue &dest, struct timeval const &src)
 Convert a struct timeval to a TimeValue.
 
TimeValue toTimeValue (struct timeval const &src)
 Convert a struct timeval to a TimeValue.
 
TimeValue fromStructTimeval (struct timeval const &src)
 Convert a struct timeval to a TimeValue.
 

Detailed Description

Functionality related to time and the OSVR_TimeValue abstraction.

Note that this is for C API-bordering areas. For purely C++ code, please use std::chrono for your time needs.

Function Documentation

OSVR_ReturnCode osvr::util::time::microsleep ( uint64_t  microseconds)
inline

Request a thread sleep for at least the given number of microseconds.

DO NOT use within a Sync plugin!

This is just a request for a minimum sleep time – operating system scheduling and sleep granularity means that you may end up sleeping for longer.

Definition at line 56 of file Microsleep.h.

double osvr::util::time::duration ( TimeValue const &  a,
TimeValue const &  b 
)
inline

Get a double containing seconds between the time points.

See also
osvrTimeValueDurationSeconds()

Definition at line 62 of file TimeValue.h.