Timer supporting RAII scope or manual stop. More...
#include <timer.hpp>
Public Member Functions | |
| Timer (const std::string &n) | |
| Constructor - starts the timer. | |
| void | stop () |
| Stop the timer and record elapsed time. | |
| ~Timer () | |
| Destructor stops timer if still running. | |
Timer supporting RAII scope or manual stop.
Starts timer on construction.
Automatically adds timing to TimerTree's singleton instance. See TimerTree for details on how to export the timings.
Example usage: scoped
Example usage: stop explicitly
|
inlineexplicit |
Constructor - starts the timer.
| n | Timer name |
|
inline |
Destructor stops timer if still running.
Can be used instead of stopping manually.
|
inline |
Stop the timer and record elapsed time.
Can be safely called twice - does not do anything on second call.