Template Class Timer

Class Documentation

template<typename DurationT, typename ClockT = std::chrono::high_resolution_clock>
class Timer

The Timer class, a minimum timer class.

Public Functions

inline explicit Timer(const std::string &name, bool start_now = true)
inline const std::string &name() const
inline void start()

Start, start timer.

inline void stop()

Stop, stop timer.

inline void reset()

Reset.

template<typename T = DurationT>
inline void sleep(int tick)

Sleep.

Parameters:

tick

template<typename T = DurationT>
inline double elapsed() const

Elapsed.

Returns:

template<typename T = DurationT>
inline std::string elapsedStr() const

elapsedStr

Returns:

template<typename T = DurationT>
inline T elapsedDuration() const

ElapsedDuration.

Returns:

template<typename T = DurationT>
inline std::string unitStr() const

UnitStr.

Returns:

inline std::string baseUnitStr() const

BaseUnitStr.

Returns:

template<typename T = DurationT>
inline double mean() const

Mean.

template<typename T = DurationT>
inline double max() const

Max.

template<typename T = DurationT>
inline double min() const

Min.

template<typename T = DurationT>
inline double sum() const

Sum.

inline size_t count() const

count

template<typename T = DurationT>
inline void report(std::ostream &os = std::cout)
template<typename T = DurationT>
inline std::string statsStr()

statsStr

template<typename T = DurationT>
inline void reportStats(std::ostream &os = std::cout)

reportStats Print stats to os