45#ifndef CPrecisionClockH
46#define CPrecisionClockH
107 void reset(
const double a_currentTime = 0.0);
110 double start(
bool a_resetClock =
false);
153#if defined(WIN32) | defined(WIN64)
Implements option settings for CHAI3D.
This class implements a high precision clock.
Definition CPrecisionClock.h:86
static bool m_initialized
If true, then static members of cPrecisionClock have been initialized.
Definition CPrecisionClock.h:162
static void initialize()
This method initializes all static variables of cPrecisionClock.
Definition CPrecisionClock.cpp:94
bool on() const
This method returns true if the clock is running (ON), otherwise false if the clock is paused (OFF).
Definition CPrecisionClock.h:116
virtual ~cPrecisionClock()
Destructor of cPrecisionClock.
Definition CPrecisionClock.h:97
static LARGE_INTEGER m_freq
Stores information about CPU high precision clock.
Definition CPrecisionClock.h:155
double m_timeAccumulated
Time accumulated between previous calls to start() and stop().
Definition CPrecisionClock.h:165
double start(bool a_resetClock=false)
This method starts the clock with optional reset.
Definition CPrecisionClock.cpp:145
double m_timeStart
CPU time in seconds when clock was started.
Definition CPrecisionClock.h:168
double stop()
This method stops the clock and return the elapsed time.
Definition CPrecisionClock.cpp:169
double getTimeoutPeriodSeconds() const
This method reads the programmed timeout period is seconds.
Definition CPrecisionClock.h:125
double m_timeoutPeriod
Timeout period in seconds.
Definition CPrecisionClock.h:171
bool timeoutOccurred() const
This method returns true if timeout has occurred, otherwise return false.
Definition CPrecisionClock.cpp:204
bool highResolution() const
This method returns true if the high resolution CPU clock is available on this computer,...
Definition CPrecisionClock.h:131
static double getCPUTimeSeconds()
This method returns the raw CPU time in seconds.
Definition CPrecisionClock.cpp:243
double getCurrentTimeSeconds() const
This method returns the current clock time in seconds.
Definition CPrecisionClock.cpp:225
cPrecisionClock()
Constructor of cPrecisionClock.
Definition CPrecisionClock.cpp:67
static bool m_highres
If true, then high precision CPU clock is available.
Definition CPrecisionClock.h:159
void reset(const double a_currentTime=0.0)
This method resets the clock.
Definition CPrecisionClock.cpp:124
bool m_on
If true, then clock is currently ON.
Definition CPrecisionClock.h:177
void setTimeoutPeriodSeconds(const double a_timeoutPeriod)
This method sets the period in seconds before a timeout occurs (you need to poll for this).
Definition CPrecisionClock.cpp:191
double m_timeoutStart
Clock time in seconds when timer was started.
Definition CPrecisionClock.h:174
Definition CAudioBuffer.cpp:57