#include <Stopwatch.h>
Common usage 1 (start and stop around timed work):
mace::Stopwatch s; s.start(); doSomeWork(); s.stop(); unrelatedWork(); s.start(); doSomeWork(); s.stop(); cout << "Time: " << s.getCumulativeTime();
Common usage 2 (when not sure whether to count iteration):
mace::Stopwatch s; do { s.start(); doSomeWork(); s.mark(); if (workWasInteresting()) { s.confirm(); } } while (notDone()); cout << "Time: " << s.getCumulativeTime();
Definition at line 79 of file Stopwatch.h.
Public Member Functions | |
| void | start () |
| set the start time | |
| void | mark () |
| set a potential stop time | |
| void | confirm () |
| accumulate markTime - startTime on the watch | |
| void | stop () |
| mark(), then confirm() | |
| uint64_t | getCumulativeTime () |
| return the cumulative of the time | |
1.5.5