OpenSceneGraph
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
osg::Timer Class Reference

Timer class is used for measuring elapsed time or time between two points. More...

Public Member Functions

 Timer ()
 
 ~Timer ()
 
Timer_t tick () const
 Get the timers tick value. More...
 
void setStartTick ()
 Set the start. More...
 
void setStartTick (Timer_t t)
 
Timer_t getStartTick () const
 
double time_s () const
 Get elapsed time in seconds. More...
 
double time_m () const
 Get elapsed time in milliseconds. More...
 
double time_u () const
 Get elapsed time in microseconds. More...
 
double time_n () const
 Get elapsed time in nanoseconds. More...
 
double delta_s (Timer_t t1, Timer_t t2) const
 Get the time in seconds between timer ticks t1 and t2. More...
 
double delta_m (Timer_t t1, Timer_t t2) const
 Get the time in milliseconds between timer ticks t1 and t2. More...
 
double delta_u (Timer_t t1, Timer_t t2) const
 Get the time in microseconds between timer ticks t1 and t2. More...
 
double delta_n (Timer_t t1, Timer_t t2) const
 Get the time in nanoseconds between timer ticks t1 and t2. More...
 
double getSecondsPerTick () const
 Get the number of seconds per tick. More...
 

Static Public Member Functions

static Timerinstance ()
 

Protected Attributes

Timer_t _startTick
 
double _secsPerTick
 

Detailed Description

Timer class is used for measuring elapsed time or time between two points.

Constructor & Destructor Documentation

◆ Timer()

osg::Timer::Timer ( )

◆ ~Timer()

osg::Timer::~Timer ( )
inline

Member Function Documentation

◆ delta_m()

double osg::Timer::delta_m ( Timer_t  t1,
Timer_t  t2 
) const
inline

Get the time in milliseconds between timer ticks t1 and t2.

◆ delta_n()

double osg::Timer::delta_n ( Timer_t  t1,
Timer_t  t2 
) const
inline

Get the time in nanoseconds between timer ticks t1 and t2.

◆ delta_s()

double osg::Timer::delta_s ( Timer_t  t1,
Timer_t  t2 
) const
inline

Get the time in seconds between timer ticks t1 and t2.

Referenced by osg::State::getGpuTime(), osgGA::EventQueue::getTime(), and osg::GraphicsContext::getTimeSinceLastClear().

◆ delta_u()

double osg::Timer::delta_u ( Timer_t  t1,
Timer_t  t2 
) const
inline

Get the time in microseconds between timer ticks t1 and t2.

◆ getSecondsPerTick()

double osg::Timer::getSecondsPerTick ( ) const
inline

Get the number of seconds per tick.

◆ getStartTick()

Timer_t osg::Timer::getStartTick ( ) const
inline

◆ instance()

static Timer* osg::Timer::instance ( )
static

◆ setStartTick() [1/2]

void osg::Timer::setStartTick ( )
inline

Set the start.

◆ setStartTick() [2/2]

void osg::Timer::setStartTick ( Timer_t  t)
inline

◆ tick()

Timer_t osg::Timer::tick ( ) const

Get the timers tick value.

◆ time_m()

double osg::Timer::time_m ( ) const
inline

Get elapsed time in milliseconds.

◆ time_n()

double osg::Timer::time_n ( ) const
inline

Get elapsed time in nanoseconds.

◆ time_s()

double osg::Timer::time_s ( ) const
inline

Get elapsed time in seconds.

◆ time_u()

double osg::Timer::time_u ( ) const
inline

Get elapsed time in microseconds.

Member Data Documentation

◆ _secsPerTick

double osg::Timer::_secsPerTick
protected

◆ _startTick

Timer_t osg::Timer::_startTick
protected

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