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 ()
 
double Stop ()
 
Statistics Methods
void Clear ()
 
double GetLastTime () const
 
double GetMin () const
 
double GetMax () const
 
double GetAverage () const
 
double GetVariance () const
 
double GetStdev () const
 

Access time records

Timer timer
 
double times [128]
 
double minTime
 
double maxTime
 
double totalTime
 
unsigned char pos
 
unsigned char GetRecordCount () const
 
const double * GetRecords () const
 

Member Function Documentation

§ Start()

void Start ( )

Starts the timer.

§ Stop()

double Stop ( )

Stops the timer and records the current measurement. Returns the time passed since Start call in seconds.

§ Clear()

void Clear ( )

Clears all the time records.

§ GetLastTime()

double GetLastTime ( ) const

Returns the last measured time. If no time is measured before, returns zero.

§ GetMin()

double GetMin ( ) const

Returns the minimum measured time.

§ GetMax()

double GetMax ( ) const

Returns the maximum measured time.

§ GetAverage()

double GetAverage ( ) const

Returns the average of all recorded times (max previous 128 records)

§ GetVariance()

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.

§ GetStdev()

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.

§ GetRecordCount()

unsigned char GetRecordCount ( ) const

Returns the number of time records.

§ GetRecords()

const double* GetRecords ( ) const

Returns the array of time records.

Member Data Documentation

§ timer

Timer timer
protected

Returns the number of time records.

§ times

double times[128]
protected

Returns the number of time records.

§ minTime

double minTime
protected

Returns the number of time records.

§ maxTime

double maxTime
protected

Returns the number of time records.

§ totalTime

double totalTime
protected

Returns the number of time records.

§ pos

unsigned char pos
protected

Returns the number of time records.