25 #ifndef INCLUDED_TimeValueChrono_h_GUID_19CA90DA_70CF_4CBD_2327_5B6335744E91
26 #define INCLUDED_TimeValueChrono_h_GUID_19CA90DA_70CF_4CBD_2327_5B6335744E91
43 template <
typename Rep,
typename Period>
46 std::chrono::duration<Rep, Period>
const &additionalTime) {
47 using namespace std::chrono;
48 using SecondsDuration = duration<OSVR_TimeValue_Seconds>;
49 using USecondsDuration = duration<OSVR_TimeValue_Microseconds, std::micro>;
51 auto seconds = duration_cast<SecondsDuration>(additionalTime);
54 duration_cast<USecondsDuration>(additionalTime - seconds).count();
59 #endif // INCLUDED_TimeValueChrono_h_GUID_19CA90DA_70CF_4CBD_2327_5B6335744E91
OSVR_TimeValue operator+(OSVR_TimeValue const &tv, std::chrono::duration< Rep, Period > const &additionalTime)
Header providing a C++ wrapper around TimeValueC.h.
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.