Files Class List
TimerStats Class Reference

Detailed Description

Stopwatch class with statistics.

Use this class to measure the time between Start and Stop calls. Unlike Timer class, this class also provides statistical information.

#include <cyTimer.h>

Public Member Functions

Timer Methods
void Start ()
 Starts the timer.
 
double Stop ()
 Stops the timer and records the current measurement. Returns the time passed since Start call in seconds.
 
Statistics Methods
void Clear ()
 Clears all the time records.
 
double GetLastTime () const
 Returns the last measured time. If no time is measured before, returns zero.
 
double GetMin () const
 Returns the minimum measured time.
 
double GetMax () const
 Returns the maximum measured time.
 
double GetAverage () const
 Returns the average of all recorded times (max previous 128 records)
 
double GetVariance () const
 Returns the variance of the time records. Note that this method goes over all time records, so it may take a little time to compute the variance.
 
double GetStdev () const
 Returns the standard deviation of the time records. Note that this method goes over all time records, so it may take a little time to compute the standard deviation.
 

Access time records

Timer timer
 Returns the number of time records.
 
double times [128]
 Returns the number of time records.
 
double minTime
 Returns the number of time records.
 
double maxTime
 Returns the number of time records.
 
double totalTime
 Returns the number of time records.
 
unsigned char pos
 Returns the number of time records.
 
unsigned char GetRecordCount () const
 Returns the number of time records.
 
double const * GetRecords () const
 Returns the array of time records.