Skip to content

EntropyEngine::Core::Debug::ScopedTimer

Scoped debug timer for measuring execution time. More…

#include <DebugUtilities.h>

Name
~ScopedTimer()
doublegetDuration() const
ScopedTimer(std::string_view name, bool logOnDestruct =true)
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());
}
}
inline ~ScopedTimer()
inline double getDuration() const
inline explicit ScopedTimer(
std::string_view name,
bool logOnDestruct =true
)

Updated on 2026-01-26 at 17:14:35 -0500