Skip to main content
Header: utils/inc/qshTimeUtil.h

Structures

qshTimeUtil

Sensors time utilities. Members
std::atomic< std::int64_t >

Functions

getInstance
get singleton instance of the timeutil class
Returns qshTimeUtil&
qtimerGetTicks
reads the current QTimer count value
Returns uint64_t QTimer tick-count
qtimerGetFreq
get QTimer frequency in Hz
Returns uint64_t
qtimerGetTimeNs
get time in nanoseconds since boot-up
Returns uint64_t nanoseconds
qtimerTicksToNs
convert the qtimer tick value of nanoseconds
Parameters
uint64_t
Returns uint64_t qtimer time in nanoseconds
qtimerNsToElapsedRealtimeNano
convert qtimer timestamp (in ns) to android system time (in ns)
Parameters
Returns int64_t
elapsedRealtimeNanoToQtimerNs
convert android system time (in ns) to qtimer timestamp (in ns)
Parameters
int64_t
Returns uint64_t
qtimerTicksToElapsedRealtimeNano
convert qtimer timestamp (in ticks) to android timestamp (in ns)
Parameters
Returns int64_t
getElapsedRealtimeNanoOffset
get offset between sensor time system and Android time system (in ns)
Returns int64_t
recalculateOffset
kick in the logic to recalculate offset for drift
Parameters
if true, always update the offset (even if the previous update was more recent than the last update)
Returns true if offset changed, false otherwise
getOffsetUpdateScheduleNs