32 template <
typename Clock,
typename Unit>
54 auto dt = Clock::now() -
m_t0;
56 return std::chrono::duration_cast<Unit>( dt );
64 typename Clock::time_point
m_t0;
71 template <
class OWNER>
auto elapsed() const
Return the elapsed time without stopping the timer.
A generic timer based on std::chrono and Gaudi::Accumulators.
A counter aiming at computing average and sum2 / variance / standard deviation.
GenericTimer()=default
Default constructor.
const Stats_t & stats() const
Return accumulated timing statistics.
GenericTimer(OWNER *o, const std::string &name)
Constructor attaching the statistics counter to an owner.
Clock::time_point m_t0
start time of timer
Gaudi::Accumulators::StatCounter< Unit > Stats_t
Type of Counter used for accumulating time measurements.
void stop() const
Stop the timer, accumulate elapsed time and return current measurement.
A scoped timer that starts/stops on con/de-struction.
auto operator()() const
Create (and start) a ScopeTimer.
Stats_t m_stats
statistics counter
T atomic_thread_fence(T... args)
ScopeTimer(Stats_t &stat)
Start Scoped timer accumulating into stat.
Header file for std:chrono::duration-based Counters.
Stats_t & m_stats
reference to statistics counter
~ScopeTimer()
Destructor stopping timer.