|
Measures the time this stop watch was inside the current scope. More...
#include <ArmarXCore/core/time/ScopedStopWatch.h>
Public Member Functions | |
ScopedStopWatch (std::function< void(const Duration &)> callback, ClockType clockType=ClockType::Virtual) | |
Constructs a ScopedStopWatch . More... | |
virtual | ~ScopedStopWatch () override |
Destructs the ScopedStopWatch . More... | |
Public Member Functions inherited from StopWatch | |
bool | isStopped () const |
Returns whether the timer is stopped or is actively measuring time. More... | |
void | reset () |
Resets the timer. More... | |
DateTime | startingTime () const |
Returns the date/time at starting the timer. More... | |
Duration | stop () |
Stops the timer and returns the measured duration. More... | |
Duration | stopAndReset () |
Stops and resets the timer. More... | |
DateTime | stoppingTime () const |
Returns the date/time at stopping the timer. More... | |
StopWatch (ClockType clockType=ClockType::Virtual) | |
Constructs a StopWatch and starts it immediately. More... | |
virtual | ~StopWatch () |
Destructs the StopWatch . More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from StopWatch | |
static Duration | measure (std::function< void(void)> subjectToMeasure, ClockType clockType=ClockType::Virtual) |
Measures the duration needed to execute the given lambda and returns it. More... | |
Measures the time this stop watch was inside the current scope.
Takes a lambda as construction parameter (taking an IceUtil::Time
as parameter), which will be called at destruction (i.e., when the scope was left).
Code example:
Definition at line 32 of file ScopedStopWatch.h.
ScopedStopWatch | ( | std::function< void(const Duration &)> | callback, |
ClockType | clockType = ClockType::Virtual |
||
) |
Constructs a ScopedStopWatch
.
callback | Callback lambda which will be called at destruction with measured time. |
clockType | Clock type. |
Definition at line 13 of file ScopedStopWatch.cpp.
|
overridevirtual |
Destructs the ScopedStopWatch
.
Definition at line 21 of file ScopedStopWatch.cpp.