Scoped RAII timer that automatically records and stores timing data. More...
#include <Timer.h>
Public Member Functions | |
| CORE_API | ScopedTimer (std::string name, std::optional< float > threshold=std::nullopt) |
| Constructs a ScopedTimer for the current scope. | |
| CORE_API | ScopedTimer (const ScopedTimer &)=delete |
| CORE_API ScopedTimer & | operator= (const ScopedTimer &)=delete |
| CORE_API | ScopedTimer (ScopedTimer &&)=delete |
| CORE_API ScopedTimer & | operator= (ScopedTimer &&)=delete |
| CORE_API | ~ScopedTimer () |
| Destroys the timer and records its elapsed time. | |
Static Public Member Functions | |
| static CORE_API const std::vector< TimerData > & | GetTimers () |
| Retrieves all stored timers. | |
| static CORE_API void | Reset () |
| Clears all stored timer data. | |
Scoped RAII timer that automatically records and stores timing data.
On destruction, the measured time is appended to a static collection for later inspection (accessible via ScopedTimer::GetTimers()), and optionally logged if a threshold is exceeded.
|
explicit |
Constructs a ScopedTimer for the current scope.
| name | Unique name for identifying the timer. |
| threshold | Optional threshold (ms) for warning logs. |
|
delete |
|
delete |
| Raven::ScopedTimer::~ScopedTimer | ( | ) |
Destroys the timer and records its elapsed time.
If a threshold was provided, a warning is logged when it's exceeded. Results are stored in a static vector for later retrieval.
|
staticnodiscard |
Retrieves all stored timers.
|
delete |
|
delete |
|
static |
Clears all stored timer data.