Drake
Drake C++ Documentation
ManualTimer Class Referencefinal

Detailed Description

Implementation of timing for use with unit tests that control time manually.

#include <drake/common/timer.h>

Public Member Functions

 ManualTimer ()
 
 ~ManualTimer () final
 
void Start () final
 Begins timing. Call Start every time you want to reset the timer to zero. More...
 
double Tick () final
 Obtains a timer measurement in seconds. More...
 
void set_tick (double tick)
 Sets the return value of Tick(). More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 ManualTimer (const ManualTimer &)=default
 
ManualTimeroperator= (const ManualTimer &)=default
 
 ManualTimer (ManualTimer &&)=default
 
ManualTimeroperator= (ManualTimer &&)=default
 
- Public Member Functions inherited from Timer
 Timer ()=default
 Properly implemented Timers must start timing upon construction. More...
 
virtual ~Timer ()
 

Additional Inherited Members

- Protected Member Functions inherited from Timer
 Timer (const Timer &)=default
 
Timeroperator= (const Timer &)=default
 
 Timer (Timer &&)=default
 
Timeroperator= (Timer &&)=default
 

Constructor & Destructor Documentation

◆ ManualTimer() [1/3]

ManualTimer ( const ManualTimer )
default

◆ ManualTimer() [2/3]

ManualTimer ( ManualTimer &&  )
default

◆ ManualTimer() [3/3]

◆ ~ManualTimer()

~ManualTimer ( )
final

Member Function Documentation

◆ operator=() [1/2]

ManualTimer& operator= ( const ManualTimer )
default

◆ operator=() [2/2]

ManualTimer& operator= ( ManualTimer &&  )
default

◆ set_tick()

void set_tick ( double  tick)

Sets the return value of Tick().

◆ Start()

void Start ( )
finalvirtual

Begins timing. Call Start every time you want to reset the timer to zero.

Implements Timer.

◆ Tick()

double Tick ( )
finalvirtual

Obtains a timer measurement in seconds.

Call this repeatedly to get multiple measurements.

Returns
the amount of time since the timer started.

Implements Timer.


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