Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::Stopwatch Class Reference

Utility class for profiling duration and frame rates. More...

#include <Stopwatch.h>

List of all members.

Public Member Functions

uint64 elapsedCycles () const
RealTime elapsedTime () const
double FPS () const
RealTime smoothElapsedTime () const
double smoothFPS () const
 Stopwatch ()
void tick ()
void tock ()


Detailed Description

Utility class for profiling duration and frame rates.


Constructor & Destructor Documentation

G3D::Stopwatch::Stopwatch (  ) 


Member Function Documentation

uint64 G3D::Stopwatch::elapsedCycles (  )  const [inline]

The elapsed cycle time between tick and tock.

An attempt is made to factor out all tick/tock overhead, so that back-to-back calls should return zero. Unreliable on non-x86 platforms.

RealTime G3D::Stopwatch::elapsedTime (  )  const [inline]

Amount of time between the most recent tick and tock calls.

0 if tick has never been called.

double G3D::Stopwatch::FPS (  )  const [inline]

Returns the number of times that tick was called per wall-clock second; e.g.

frames-per-second.

RealTime G3D::Stopwatch::smoothElapsedTime (  )  const [inline]

Time-smoothed value that is stable to the nearest 1%.

This is useful if you are displaying elapsed time in real-time and want a stable number.

double G3D::Stopwatch::smoothFPS (  )  const [inline]

Time-smoothed value of fps that is stable to the nearest integer for fps > 10 and to the first decimal place for fps <= 10.

This is useful if you are displaying the frame rate in real-time and want a stable (readable) number.

void G3D::Stopwatch::tick (  ) 

Call at the beginning of the period that you want timed.

void G3D::Stopwatch::tock (  ) 

Call at the end of the period that you want timed.


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:47 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo