Go to the documentation of this file.
42 template <
typename Clock,
typename Unit>
64 auto dt = Clock::now() -
m_t0;
66 return std::chrono::duration_cast<Unit>( dt );
74 typename Clock::time_point
m_t0;
81 template <
class OWNER>
A generic timer based on std::chrono and Gaudi::Accumulators.
const Stats_t & stats() const
Return accumulated timing statistics.
Clock::time_point m_t0
start time of timer
A scoped timer that starts/stops on con/de-struction.
GenericTimer()=default
Default constructor.
ScopeTimer(Stats_t &stat)
Start Scoped timer accumulating into stat.
void stop() const
Stop the timer, accumulate elapsed time and return current measurement.
auto operator()() const
Create (and start) a ScopeTimer.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
GenericTimer(OWNER *o, const std::string &name)
Constructor attaching the statistics counter to an owner.
Stats_t & m_stats
reference to statistics counter
~ScopeTimer()
Destructor stopping timer.
Stats_t m_stats
statistics counter
auto elapsed() const
Return the elapsed time without stopping the timer.
Gaudi::Accumulators::StatCounter< Unit > Stats_t
Type of Counter used for accumulating time measurements.
GenericTimer(const GenericTimer &)=delete
No copy.
T atomic_thread_fence(T... args)