Timer Class Reference

A timer class, used to time things in real world walltime. More...

#include <common/common.hh>

Inherited by DiagnosticTimer.

Public Member Functions

 Timer ()
 Default constructor. More...
 
 Timer (const Time &_maxTime, const bool _countdown=true)
 Countdown constructor. More...
 
virtual ~Timer ()
 Destructor. More...
 
Time GetElapsed () const
 Get the elapsed time. More...
 
bool GetRunning () const
 Returns true if the timer is running. More...
 
void Reset ()
 Reset the timer. More...
 
virtual void Start ()
 Start the timer. More...
 
virtual void Stop ()
 Stop the timer. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const gazebo::common::Timer &t)
 Stream operator friendly. More...
 

Detailed Description

A timer class, used to time things in real world walltime.

Constructor & Destructor Documentation

◆ Timer() [1/2]

Timer ( )

Default constructor.

◆ Timer() [2/2]

Timer ( const Time _maxTime,
const bool  _countdown = true 
)

Countdown constructor.

Parameters
[in]_maxTimeThe time to count down from.
[in]_countdown.Whether or not to count down. True by default if this constructor is used.

◆ ~Timer()

virtual ~Timer ( )
virtual

Destructor.

Member Function Documentation

◆ GetElapsed()

Time GetElapsed ( ) const

Get the elapsed time.

Returns
The time

◆ GetRunning()

bool GetRunning ( ) const

Returns true if the timer is running.

Returns
Tue if the timer has been started and not stopped.

◆ Reset()

void Reset ( )

Reset the timer.

◆ Start()

virtual void Start ( )
virtual

Start the timer.

Reimplemented in DiagnosticTimer.

◆ Stop()

virtual void Stop ( )
virtual

Stop the timer.

Reimplemented in DiagnosticTimer.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const gazebo::common::Timer t 
)
friend

Stream operator friendly.


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