osg::ElapsedTime Class Reference

`#include <Timer>`

## Public Member Functions

| ElapsedTime (double *elapsedTime, osg::Timer *timer=0)
| ElapsedTime (osg::Timer *timer=0)
| ~ElapsedTime ()
void | reset ()
double | elapsedTime () const
double | elapsedTime_m () const
double | elapsedTime_u () const
double | elapsedTime_n () const
void | finish ()

## Protected Member Functions

void | init (osg::Timer *timer)

## Protected Attributes

double * | _time
Timer * | _timer
Timer_t | _startTick

## Detailed Description

Helper class for timing sections of code.

## Constructor & Destructor Documentation

## ElapsedTime() [1/2]

osg::ElapsedTime::ElapsedTime | ( | double * | elapsedTime,
|  | osg::Timer * | timer = 0 )

inline

References _time, elapsedTime(), and init().

## ElapsedTime() [2/2]

osg::ElapsedTime::ElapsedTime | ( | osg::Timer * | timer = 0 | ) |

inline

References _time, and init().

## ~ElapsedTime()

osg::ElapsedTime::~ElapsedTime | ( |  | ) |

inline

References finish().

## Member Function Documentation

## elapsedTime()

double osg::ElapsedTime::elapsedTime | ( |  | ) | const

inline

elapsed time in seconds.

References _startTick, and _timer.

Referenced by ElapsedTime().

## elapsedTime_m()

double osg::ElapsedTime::elapsedTime_m | ( |  | ) | const

inline

elapsed time in milliseconds.

References _startTick, and _timer.

## elapsedTime_n()

double osg::ElapsedTime::elapsedTime_n | ( |  | ) | const

inline

elapsed time in nanoseconds.

References _startTick, and _timer.

## elapsedTime_u()

double osg::ElapsedTime::elapsedTime_u | ( |  | ) | const

inline

elapsed time in microseconds.

References _startTick, and _timer.

## finish()

void osg::ElapsedTime::finish | ( |  | ) |

inline

References _startTick, _time, and _timer.

Referenced by ~ElapsedTime().

## init()

void osg::ElapsedTime::init | ( | osg::Timer * | timer | ) |

inline protected

References _startTick, _timer, and osg::Timer::instance().

Referenced by ElapsedTime(), and ElapsedTime().

## reset()

void osg::ElapsedTime::reset | ( |  | ) |

inline

References _startTick, and _timer.

## Member Data Documentation

## _startTick

Timer_t osg::ElapsedTime::_startTick

protected

Referenced by elapsedTime(), elapsedTime_m(), elapsedTime_n(), elapsedTime_u(), finish(), init(), and reset().

## _time

double* osg::ElapsedTime::_time

protected

Referenced by ElapsedTime(), ElapsedTime(), and finish().

## _timer

Timer* osg::ElapsedTime::_timer

protected

Referenced by elapsedTime(), elapsedTime_m(), elapsedTime_n(), elapsedTime_u(), finish(), init(), and reset().

The documentation for this class was generated from the following file:

- Timer