ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::AveragingScopedTimer Class Reference

A timer class that measures and averages execution times of multiple samples. More...

#include <Acts/Utilities/ScopedTimer.hpp>

Classes

class  Sample
 RAII wrapper class for measuring individual timing samples. More...

Public Types

using clock_type = std::chrono::high_resolution_clock
 Type alias for high resolution clock used for timing measurements.

Public Member Functions

 AveragingScopedTimer (AveragingScopedTimer &&)=delete
 AveragingScopedTimer (const AveragingScopedTimer &)=delete
 AveragingScopedTimer (const std::string &name, const Logger &logger, Logging::Level lvl=Logging::Level::INFO)
 Construct a new AveragingScopedTimer.
 ~AveragingScopedTimer ()
 Destroy the AveragingScopedTimer and log statistics.
AveragingScopedTimeroperator= (AveragingScopedTimer &&)=delete
AveragingScopedTimeroperator= (const AveragingScopedTimer &)=delete
Sample sample ()
 Create a new timing sample.

Detailed Description

A timer class that measures and averages execution times of multiple samples.

This class provides functionality to measure execution times of code blocks and calculate statistics (mean, standard deviation) across multiple samples. It uses RAII through the Sample class to automatically record timing information.

Member Typedef Documentation

◆ clock_type

using Acts::AveragingScopedTimer::clock_type = std::chrono::high_resolution_clock

Type alias for high resolution clock used for timing measurements.

Constructor & Destructor Documentation

◆ AveragingScopedTimer() [1/3]

Acts::AveragingScopedTimer::AveragingScopedTimer ( const std::string & name,
const Logger & logger,
Logging::Level lvl = Logging::Level::INFO )
explicit

Construct a new AveragingScopedTimer.

Parameters
nameName of the timer for logging
loggerLogger instance to use for output
lvlLogging level for timing output

◆ ~AveragingScopedTimer()

Acts::AveragingScopedTimer::~AveragingScopedTimer ( )

Destroy the AveragingScopedTimer and log statistics.

Outputs total duration and per-sample statistics (mean ± stddev) if logging is enabled at the configured level.

◆ AveragingScopedTimer() [2/3]

Acts::AveragingScopedTimer::AveragingScopedTimer ( const AveragingScopedTimer & )
delete

◆ AveragingScopedTimer() [3/3]

Acts::AveragingScopedTimer::AveragingScopedTimer ( AveragingScopedTimer && )
delete

Member Function Documentation

◆ operator=() [1/2]

AveragingScopedTimer & Acts::AveragingScopedTimer::operator= ( AveragingScopedTimer && )
delete

◆ operator=() [2/2]

AveragingScopedTimer & Acts::AveragingScopedTimer::operator= ( const AveragingScopedTimer & )
delete

◆ sample()

Sample Acts::AveragingScopedTimer::sample ( )

Create a new timing sample.

Returns
Sample RAII wrapper for measuring a single timing sample