|
qb
2.0.0.0
C++17 Actor Framework
|
Utility for measuring code block execution time. More...
#include <timestamp.h>
Public Types | |
| using | TimerCallback = std::function<void(Duration)> |
Public Member Functions | |
| ScopedTimer (TimerCallback callback) | |
| Constructs a timer with a callback. | |
| ~ScopedTimer () | |
| Destructor that invokes callback with elapsed time. | |
| Duration | stop () |
| Stops the timer and invokes callback if active. | |
| void | restart () |
| Restarts the timer. | |
| Duration | elapsed () const |
| Gets elapsed time without stopping timer. | |
| ScopedTimer (const ScopedTimer &)=delete | |
| ScopedTimer & | operator= (const ScopedTimer &)=delete |
| ScopedTimer (ScopedTimer &&)=delete | |
| ScopedTimer & | operator= (ScopedTimer &&)=delete |
Utility for measuring code block execution time.
Measures elapsed time between construction and destruction, optionally invoking a callback with the measured duration.
|
inlineexplicit |
Constructs a timer with a callback.
| callback | Function to call with measured duration when timer is destroyed |
|
inline |
Stops the timer and invokes callback if active.
|
inline |
Gets elapsed time without stopping timer.