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) 154 static LARGE_INTEGER
m_freq;
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
static LARGE_INTEGER m_freq
Stores information about CPU high precision clock.
Definition: CPrecisionClock.h:155
This class implements a high precision clock.
Definition: CPrecisionClock.h:85
bool timeoutOccurred() const
This method returns true if timeout has occurred, otherwise return false.
Definition: CPrecisionClock.cpp:202
static double getCPUTimeSeconds()
This method returns the raw CPU time in seconds.
Definition: CPrecisionClock.cpp:241
static bool m_initialized
If true, then static members of cPrecisionClock have been initialized.
Definition: CPrecisionClock.h:162
bool m_on
If true, then clock is currently ON.
Definition: CPrecisionClock.h:177
double start(bool a_resetClock=false)
This method starts the clock with optional reset.
Definition: CPrecisionClock.cpp:143
bool highResolution() const
This method returns true if the high resolution CPU clock is available on this computer, false. otherwise.
Definition: CPrecisionClock.h:131
void reset(const double a_currentTime=0.0)
This method resets the clock.
Definition: CPrecisionClock.cpp:122
Implements option settings for CHAI3D.
double stop()
This method stops the clock and return the elapsed time.
Definition: CPrecisionClock.cpp:167
double m_timeoutStart
Clock time in seconds when timer was started.
Definition: CPrecisionClock.h:174
double getTimeoutPeriodSeconds() const
This method reads the programmed timeout period is seconds.
Definition: CPrecisionClock.h:125
double getCurrentTimeSeconds() const
This method returns the current clock time in seconds.
Definition: CPrecisionClock.cpp:223
static void initialize()
This method initializes all static variables of cPrecisionClock.
Definition: CPrecisionClock.cpp:92
cPrecisionClock()
Constructor of cPrecisionClock.
Definition: CPrecisionClock.cpp:65
double m_timeStart
CPU time in seconds when clock was started.
Definition: CPrecisionClock.h:168
Definition: CAudioBuffer.cpp:56
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:189
static bool m_highres
If true, then high precision CPU clock is available.
Definition: CPrecisionClock.h:159
double m_timeoutPeriod
Timeout period in seconds.
Definition: CPrecisionClock.h:171
double m_timeAccumulated
Time accumulated between previous calls to start() and stop().
Definition: CPrecisionClock.h:165
virtual ~cPrecisionClock()
Destructor of cPrecisionClock.
Definition: CPrecisionClock.h:97