Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

XFuTimingCounter Class Reference

Timing counter that takes average of a definable amount of samples. More...

#include <XFuTimingCounter.h>

List of all members.

Public Member Functions

virtual void start ()
 Starts counting of one timing iteration.

virtual void stop ()
 Stops counting of one timing iteration.

virtual void pause ()
 Pauses the counting.

virtual void resume ()
 Resumes the counting.

virtual void reset ()
 Resets the counter.

virtual REAL getTime ()
 Returns the average time spent between start() and stop() calls.

virtual ~XFuTimingCounter ()
 Virtual destructor.


Static Public Member Functions

XFuTimingCounter * create (INT32 aSampleCount)
 Constructs the timing counter with aSampleCount amount of samples.


Protected Member Functions

 XFuTimingCounter ()

Protected Attributes

INT32 * mSamples
INT32 mSampleCount
INT32 mMaxSampleCount
INT32 mFirstSample
INT32 mCurrentSample
INT32 mCurrentTick
INT32 mTickDiff
INT32 mState


Detailed Description

Timing counter that takes average of a definable amount of samples.

This counter can be used for evaluating time spend within functions even in the case the time is less than the resolution of the clock. The timer takes sliding average of large amount of samples, and thus gives results that are statistically more accurate than the clock itself.

Definition at line 25 of file XFuTimingCounter.h.


Constructor & Destructor Documentation

virtual XFuTimingCounter::~XFuTimingCounter   [inline, virtual]
 

Virtual destructor.

Definition at line 121 of file XFuTimingCounter.h.

References mSamples.

XFuTimingCounter::XFuTimingCounter   [inline, protected]
 

Definition at line 127 of file XFuTimingCounter.h.

References mCurrentSample, mFirstSample, mMaxSampleCount, mSampleCount, and mSamples.

Referenced by create().


Member Function Documentation

XFuTimingCounter* XFuTimingCounter::create INT32    aSampleCount [inline, static]
 

Constructs the timing counter with aSampleCount amount of samples.

Definition at line 29 of file XFuTimingCounter.h.

References mMaxSampleCount, mSamples, and XFuTimingCounter().

virtual REAL XFuTimingCounter::getTime   [inline, virtual]
 

Returns the average time spent between start() and stop() calls.

Definition at line 112 of file XFuTimingCounter.h.

References mCurrentSample, mFirstSample, mSampleCount, and mSamples.

virtual void XFuTimingCounter::pause   [inline, virtual]
 

Pauses the counting.

Definition at line 80 of file XFuTimingCounter.h.

References mCurrentTick, mState, mTickDiff, XFU_TIMINGCOUNTER_RUNNING, and XFU_TIMINGCOUNTER_STARTED.

Referenced by stop().

virtual void XFuTimingCounter::reset   [inline, virtual]
 

Resets the counter.

Definition at line 103 of file XFuTimingCounter.h.

References mCurrentSample, mFirstSample, mSampleCount, and mState.

virtual void XFuTimingCounter::resume   [inline, virtual]
 

Resumes the counting.

Definition at line 92 of file XFuTimingCounter.h.

References mCurrentTick, mState, XFU_TIMINGCOUNTER_RUNNING, and XFU_TIMINGCOUNTER_STARTED.

Referenced by start().

virtual void XFuTimingCounter::start   [inline, virtual]
 

Starts counting of one timing iteration.

Definition at line 52 of file XFuTimingCounter.h.

References mState, mTickDiff, resume(), and XFU_TIMINGCOUNTER_STARTED.

virtual void XFuTimingCounter::stop   [inline, virtual]
 

Stops counting of one timing iteration.

Definition at line 60 of file XFuTimingCounter.h.

References mCurrentSample, mFirstSample, mMaxSampleCount, mSampleCount, mSamples, mState, mTickDiff, pause(), and XFU_TIMINGCOUNTER_STARTED.


Member Data Documentation

INT32 XFuTimingCounter::mCurrentSample [protected]
 

Definition at line 140 of file XFuTimingCounter.h.

Referenced by getTime(), reset(), stop(), and XFuTimingCounter().

INT32 XFuTimingCounter::mCurrentTick [protected]
 

Definition at line 141 of file XFuTimingCounter.h.

Referenced by pause(), and resume().

INT32 XFuTimingCounter::mFirstSample [protected]
 

Definition at line 139 of file XFuTimingCounter.h.

Referenced by getTime(), reset(), stop(), and XFuTimingCounter().

INT32 XFuTimingCounter::mMaxSampleCount [protected]
 

Definition at line 138 of file XFuTimingCounter.h.

Referenced by create(), stop(), and XFuTimingCounter().

INT32 XFuTimingCounter::mSampleCount [protected]
 

Definition at line 137 of file XFuTimingCounter.h.

Referenced by getTime(), reset(), stop(), and XFuTimingCounter().

INT32* XFuTimingCounter::mSamples [protected]
 

Definition at line 136 of file XFuTimingCounter.h.

Referenced by create(), getTime(), stop(), XFuTimingCounter(), and ~XFuTimingCounter().

INT32 XFuTimingCounter::mState [protected]
 

Definition at line 143 of file XFuTimingCounter.h.

Referenced by pause(), reset(), resume(), start(), and stop().

INT32 XFuTimingCounter::mTickDiff [protected]
 

Definition at line 142 of file XFuTimingCounter.h.

Referenced by pause(), start(), and stop().


The documentation for this class was generated from the following file:
   
X-Forge Documentation
Confidential
Copyright © 2002-2003 Fathammer
   
Documentation generated
with doxygen
by Dimitri van Heesch