EntropyEngine::Core::Debug::ScopedTimer
EntropyEngine::Core::Debug::ScopedTimer
Section titled “EntropyEngine::Core::Debug::ScopedTimer”Scoped debug timer for measuring execution time. More…
#include <DebugUtilities.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| ~ScopedTimer() | |
| double | getDuration() const |
| ScopedTimer(std::string_view name, bool logOnDestruct =true) |
Detailed Description
Section titled “Detailed Description”class EntropyEngine::Core::Debug::ScopedTimer;Scoped debug timer for measuring execution time.
Automatically measures and logs execution time when destroyed. Uses high-resolution clocks for microsecond precision.
void expensiveOperation() { ScopedTimer timer("ExpensiveOperation");
// Perform work processLargeDataset();
} // Automatically logs: "ExpensiveOperation took 1234.567ms"
// Manual duration checking{ ScopedTimer timer("CustomTiming", false); // Disable automatic logging doWork(); if (timer.getDuration() > 100.0) { LOG_WARN("Operation exceeded time limit: {:.2f}ms", timer.getDuration()); }}Public Functions Documentation
Section titled “Public Functions Documentation”function ~ScopedTimer
Section titled “function ~ScopedTimer”inline ~ScopedTimer()function getDuration
Section titled “function getDuration”inline double getDuration() constfunction ScopedTimer
Section titled “function ScopedTimer”inline explicit ScopedTimer( std::string_view name, bool logOnDestruct =true)Updated on 2026-01-26 at 17:14:35 -0500