Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
|
A utility class that helps with timing. More...
#include <ScopedTimer.h>
Public Member Functions | |
ScopedTimer (std::string name) | |
Create a scoped timer with the specified name. | |
ScopedTimer () | |
Create an unnamed scoped timer. | |
std::chrono::microseconds | elapsedTime () const |
Gets the elapsed time measured by this timer. | |
A utility class that helps with timing.
Measures the elapsed time from the moment this class is instantiated to the moment that it's destructed.
util::ScopedTimer::ScopedTimer | ( | std::string | name | ) |
Create a scoped timer with the specified name.
The elapsed time will be printed to stdout when destructed.
name | The name of this timer. |
util::ScopedTimer::ScopedTimer | ( | ) |
Create an unnamed scoped timer.
Nothing will be printed by this timer.
std::chrono::microseconds util::ScopedTimer::elapsedTime | ( | ) | const |
Gets the elapsed time measured by this timer.