18 #ifndef ZENI_TIMER_HQ_HXX
19 #define ZENI_TIMER_HQ_HXX
40 return m_ticks - time.m_ticks;
44 return static_cast<long double>(
get_ticks_since(time)) / m_ticks_per_second;
61 return m_ticks_per_second;
65 return static_cast<long double>(double(
get_ticks())) / m_ticks_per_second;
71 return Time_HQ(m_ticks, m_ticks_per_second);
77 void Timer_HQ::update() {
79 LARGE_INTEGER lpPerformanceCount;
80 QueryPerformanceCounter(&lpPerformanceCount);
82 m_ticks = lpPerformanceCount.QuadPart;
83 #elif defined(_MACOSX)
84 m_ticks = orwl_gettime();
86 clock_gettime(CLOCK_MONOTONIC, &m_ticks);
91 return m_ticks < rhs.m_ticks;
bool operator<(const Time_HQ &rhs) const
A Snapshot of the Timer_HQ.
void update()
Update to current Time.
Timer_HQ & get_Timer_HQ()
Get access to the singleton.
HQ_Tick_Type get_ticks()
Get the number of ticks passed since instantiation.
Time_HQ & operator=(const HQ_Tick_Type &ticks)
long double to_useconds(const timespec &ticks)
HQ_Tick_Type get_ticks_since(const Time_HQ &time) const
Get the number of clock ticks passed between 'time' and this Time.
long double get_seconds_passed() const
Get the number of seconds passed since this Time.
Time_HQ get_time()
Get the current Time.
HQ_Tick_Type get_ticks_passed() const
Get the number of clock ticks passed since this Time.
HQ_Tick_Type get_ticks_per_second()
Get the number of ticks per second.
long double get_seconds()
Get the number of seconds passed since instantiation.
long double get_seconds_since(const Time_HQ &time) const
Get the number of seconds passed between 'time' and this Time.