C++ Utilities
Loading...
Searching...
No Matches
stopwatch.h

A stopwatch class to measure execution times.
See the Stopwatch page for all the details. More...

Go to the source code of this file.

Classes

class  utilities::stopwatch< Clock >
 See the Stopwatch page for all the details. More...

Namespaces

namespace  utilities
 The namespace for the utilities library.

Typedefs

using utilities::precise_stopwatch = stopwatch<std::chrono::high_resolution_clock>
 Theoretically the most precise stopwatch – it might get put off by system reboots etc.
using utilities::steady_stopwatch = stopwatch<std::chrono::steady_clock>
 A stopwatch that is guaranteed to be monotonic.
using utilities::system_stopwatch = stopwatch<std::chrono::system_clock>
 A stopwatch that is uses the system clock.

Functions

template<typename Clock>
std::ostream & utilities::operator<< (std::ostream &os, const stopwatch< Clock > &rhs)
 The usual output operator.
template<class Rep, class Period>
constexpr double utilities::to_seconds (const std::chrono::duration< Rep, Period > &d)
 A convenience function that converts a std::chrono::duration to a double number of seconds.

Detailed Description

A stopwatch class to measure execution times.
See the Stopwatch page for all the details.