25 #ifndef INCLUDED_TimeValue_h_GUID_AD9F3D81_382D_4394_433B_A8026BE803B6
26 #define INCLUDED_TimeValue_h_GUID_AD9F3D81_382D_4394_433B_A8026BE803B6
62 inline double duration(TimeValue
const &a, TimeValue
const &b) {
68 std::ostringstream os;
73 bool negative =
false;
89 os << std::setw(6) << std::setfill(
'0');
96 #ifdef OSVR_HAVE_STRUCT_TIMEVAL
99 TimeValue
const &src) {
105 struct timeval
const &src) {
120 #ifdef OSVR_STRUCT_TIMEVAL_INCLUDED
127 #endif // OSVR_STRUCT_TIMEVAL_INCLUDED
129 #endif // OSVR_HAVE_STRUCT_TIMEVAL
135 #endif // INCLUDED_TimeValue_h_GUID_AD9F3D81_382D_4394_433B_A8026BE803B6
OSVR_EXTERN_C_END double osvrTimeValueDurationSeconds(const OSVR_TimeValue *tvA, const OSVR_TimeValue *tvB)
Compute the difference between the two time values, returning the duration as a double-precision floa...
void getNow(TimeValue &tv)
Set the given TimeValue to the current time.
The main namespace for all C++ elements of the framework, internal and external.
void osvrTimeValueGetNow(OSVR_TimeValue *dest)
Gets the current time in the TimeValue. Parallel to gettimeofday.
void toStructTimeval(struct timeval &dest, TimeValue const &src)
Convert a TimeValue to a struct timeval.
TimeValue toTimeValue(struct timeval const &src)
Convert a struct timeval to a TimeValue.
::OSVR_TimeValue TimeValue
C++-friendly typedef for the OSVR_TimeValue structure.
double duration(TimeValue const &a, TimeValue const &b)
Get a double containing seconds between the time points.
void fromStructTimeval(TimeValue &dest, struct timeval const &src)
Convert a struct timeval to a TimeValue.
void osvrTimeValueToStructTimeval(struct timeval *dest, const OSVR_TimeValue *src)
Converts from a TimeValue struct to your system's struct timeval.
void osvrStructTimevalToTimeValue(OSVR_TimeValue *dest, const struct timeval *src)
Converts from a TimeValue struct to your system's struct timeval.
OSVR_TimeValue_Microseconds microseconds
Microseconds portion of the time value.
std::string toDecimalString(TimeValue tv)
Converts to a precise decimal string.
Header defining a dependency-free, cross-platform substitute for struct timeval.
Header forward-declaring TimeValue C++ API.
struct OSVR_TimeValue OSVR_TimeValue
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
void osvrTimeValueNormalize(OSVR_TimeValue *tv)
"Normalizes" a time value so that the absolute number of microseconds is less than 1...
OSVR_TimeValue_Seconds seconds
Seconds portion of the time value.