A class for conveniently measuring execution time. More...
#include <Stopwatch.hpp>
Classes | |
| class | Operator |
| RAII-style operation of a stopwatch. More... | |
Public Member Functions | |
| void | start () |
| Starts measuring time. | |
| void | pause () |
pauses measurement and updates time() | |
| void | reset () |
resets time() to zero | |
| bool | running () const |
false if the stopwatch has been stopped since the last time it was started | |
| int | n_calls () const |
number of times the stopwatch has been stopped. | |
| double | time () const |
total elapsed time between start()s and stop()s since the last reset() | |
| Stopwatch | operator+ (Stopwatch other) const |
| Stopwatch & | operator+= (Stopwatch other) |
adds time and n_calls, throws if either is running | |
A class for conveniently measuring execution time.
Measures wall clock time. Can be started and stopped multiple times.
| void hexed::Stopwatch::pause | ( | ) |
pauses measurement and updates time()
Throws an exception if not running.
| void hexed::Stopwatch::start | ( | ) |
Starts measuring time.
Throws an exception if already running.