|
ACTS
Experiment-independent tracking
|
A RAII timer class for measuring execution time of code blocks. More...
#include <Acts/Utilities/ScopedTimer.hpp>
Public Types | |
| using | clock_type = std::chrono::high_resolution_clock |
| Type alias for high resolution clock used for timing. | |
Public Member Functions | |
| ScopedTimer (const ScopedTimer &)=delete | |
| ScopedTimer (const std::string &name, const Logger &logger, Logging::Level lvl=Logging::Level::INFO) | |
| Construct a new Scoped Timer. | |
| ScopedTimer (ScopedTimer &&)=delete | |
| ~ScopedTimer () | |
| Destructor that logs the execution time. | |
| ScopedTimer & | operator= (const ScopedTimer &)=delete |
| ScopedTimer & | operator= (ScopedTimer &&)=delete |
A RAII timer class for measuring execution time of code blocks.
ScopedTimer provides automatic timing of code blocks using RAII principles. It starts timing when constructed and automatically logs the duration when destroyed. This makes it ideal for measuring execution time of functions or code blocks without manual start/stop calls.
Example usage:
| using Acts::ScopedTimer::clock_type = std::chrono::high_resolution_clock |
Type alias for high resolution clock used for timing.
|
explicit |
Construct a new Scoped Timer.
| name | Identifier for the timed block |
| logger | Logger instance to use for output |
| lvl | Logging level for the timing output |
| Acts::ScopedTimer::~ScopedTimer | ( | ) |
Destructor that logs the execution time.
Automatically calculates and logs the duration between construction and destruction using the specified logger and level.
|
delete |
|
delete |
|
delete |
|
delete |