25 #ifndef INCLUDED_TimeValue_h_GUID_AD9F3D81_382D_4394_433B_A8026BE803B6 26 #define INCLUDED_TimeValue_h_GUID_AD9F3D81_382D_4394_433B_A8026BE803B6 51 inline void getNow(TimeValue &tv) { osvrTimeValueGetNow(&tv); }
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 97 inline void toStructTimeval(
struct timeval &dest,
99 TimeValue
const &src) {
100 osvrTimeValueToStructTimeval(&dest, &src);
104 inline void fromStructTimeval(TimeValue &dest,
105 struct timeval
const &src) {
106 osvrStructTimevalToTimeValue(&dest, &src);
110 inline TimeValue toTimeValue(
struct timeval
const &src) {
112 osvrStructTimevalToTimeValue(&dest, &src);
116 inline TimeValue fromStructTimeval(
struct timeval
const &src) {
117 return toTimeValue(src);
120 #ifdef OSVR_STRUCT_TIMEVAL_INCLUDED 121 inline struct timeval toStructTimeval(TimeValue const &src) {
124 osvrTimeValueToStructTimeval(&dest, &src);
127 #endif // OSVR_STRUCT_TIMEVAL_INCLUDED 129 #endif // OSVR_HAVE_STRUCT_TIMEVAL 135 #endif // INCLUDED_TimeValue_h_GUID_AD9F3D81_382D_4394_433B_A8026BE803B6 Definition: RunLoopManager.h:42
void getNow(TimeValue &tv)
Set the given TimeValue to the current time.
Definition: TimeValue.h:51
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT int OSVR_EXTERN_C_END OSVR_INLINE double osvrTimeValueDurationSeconds(OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB)
Compute the difference between the two time values, returning the duration as a double-precision floa...
Definition: TimeValueC.h:185
::OSVR_TimeValue TimeValue
C++-friendly typedef for the OSVR_TimeValue structure.
Definition: TimeValue.h:48
double duration(TimeValue const &a, TimeValue const &b)
Get a double containing seconds between the time points.
Definition: TimeValue.h:62
OSVR_UTIL_EXPORT void osvrTimeValueNormalize(OSVR_INOUT_PTR OSVR_TimeValue *tv) OSVR_FUNC_NONNULL((1))
"Normalizes" a time value so that the absolute number of microseconds is less than 1...
Definition: TimeValueC.cpp:46
OSVR_TimeValue_Microseconds microseconds
Microseconds portion of the time value.
Definition: TimeValueC.h:85
std::string toDecimalString(TimeValue tv)
Converts to a precise decimal string.
Definition: TimeValue.h:67
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...
OSVR_TimeValue_Seconds seconds
Seconds portion of the time value.
Definition: TimeValueC.h:83