26 #ifndef LBANN_UTILS_TIMER_MAP_HPP_INCLUDED 27 #define LBANN_UTILS_TIMER_MAP_HPP_INCLUDED 56 std::string
const&
key()
const noexcept;
63 void print(std::ostream& os)
const;
66 void print_impl(std::ostream& os,
unsigned width,
unsigned indent)
const;
85 template <typename TimerT>
106 [&
key](
auto& t) {
return t.key() ==
key; });
114 : m_timer{&(timer.
scope(scope_name))}
130 #endif // LBANN_UTILS_TIMER_MAP_HPP_INCLUDED TimerMap(std::string const &key)
Timer that accumulates mean and variance of timer durations as it goes.
std::list< TimerMap > m_subscopes
TimerMap & scope(std::string const &key)
double stop() noexcept
Get the elapsed time for this duration in seconds.
void start() noexcept
Start counting time for this duration sample.
A nesting inclusive-timer.
auto time_scope(TimerT &timer, std::string const &scope_name)
void print(std::ostream &os) const
void print_impl(std::ostream &os, unsigned width, unsigned indent) const
AccumulatingTimer & timer() noexcept
ScopeTimer(TimerMap &timer, std::string const &scope_name)
std::string const & key() const noexcept
AccumulatingTimer m_timer