qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::LogTimer Class Reference

Utility for logging execution time of code blocks. More...

#include <timestamp.h>

Public Member Functions

 LogTimer (std::string reason)
 Constructs a timer with a descriptive reason.
Duration elapsed () const
 Gets elapsed time without stopping timer.

Detailed Description

Utility for logging execution time of code blocks.

Creates a timer that logs the elapsed time when it goes out of scope. Useful for performance measurements and debugging.

Constructor & Destructor Documentation

◆ LogTimer()

qb::LogTimer::LogTimer ( std::string reason)
inlineexplicit

Constructs a timer with a descriptive reason.

Parameters
reasonDescription of what is being timed

Member Function Documentation

◆ elapsed()

Duration qb::LogTimer::elapsed ( ) const
inline

Gets elapsed time without stopping timer.

Returns
Current elapsed duration