- 3.0.2 core module.
ct::core::tpl::Timer< SCALAR > Class Template Reference

A timer ("stop watch") to record elapsed time based on the system clock. More...

#include <Timer.h>

Public Member Functions

 Timer ()
 Default constructor. More...
 
void start ()
 Trigger start. More...
 
void stop ()
 Trigger stop. More...
 
SCALAR getElapsedTime () const
 Get the elapsed time between calls to start() and stop() More...
 
void reset ()
 Resets the clock. More...
 

Detailed Description

template<typename SCALAR = double>
class ct::core::tpl::Timer< SCALAR >

A timer ("stop watch") to record elapsed time based on the system clock.

Keeps track of time in a stop watch fashion.

Constructor & Destructor Documentation

◆ Timer()

template<typename SCALAR = double>
ct::core::tpl::Timer< SCALAR >::Timer ( )
inline

Default constructor.

References ct::core::tpl::Timer< SCALAR >::reset().

Member Function Documentation

◆ start()

template<typename SCALAR = double>
void ct::core::tpl::Timer< SCALAR >::start ( )
inline

Trigger start.

Starts the time measurement. Can be re-triggered without calling stop(). Simply overrides the start timestamp.

Referenced by TEST().

◆ stop()

template<typename SCALAR = double>
void ct::core::tpl::Timer< SCALAR >::stop ( )
inline

Trigger stop.

Stops the time measurement.

Referenced by TEST().

◆ getElapsedTime()

template<typename SCALAR = double>
SCALAR ct::core::tpl::Timer< SCALAR >::getElapsedTime ( ) const
inline

Get the elapsed time between calls to start() and stop()

Returns
time in seconds

Referenced by TEST().

◆ reset()

template<typename SCALAR = double>
void ct::core::tpl::Timer< SCALAR >::reset ( )
inline

Resets the clock.

Not needed to be called after start()/stop() calls.

Referenced by TEST(), and ct::core::tpl::Timer< SCALAR >::Timer().


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