A simple stopwatch class leveraging chrono high resolution clock. More...
#include <stopwatch.h>
Public Member Functions | |
| double | elapsedMilliseconds () const |
| Get the elapsed time in milliseconds. More... | |
| double | elapsedSeconds () const |
| Get the elapsed time in seconds. More... | |
| void | start () |
| Start the timer. More... | |
| void | stop () |
| Stop the timer. More... | |
Private Types | |
| using | Clock = std::chrono::steady_clock |
Private Attributes | |
| std::chrono::time_point< Clock > | end_time_ |
| bool | running_ { false } |
| std::chrono::time_point< Clock > | start_time_ |
A simple stopwatch class leveraging chrono high resolution clock.
Definition at line 37 of file stopwatch.h.
|
private |
Definition at line 39 of file stopwatch.h.
| double tesseract_common::Stopwatch::elapsedMilliseconds | ( | ) | const |
Get the elapsed time in milliseconds.
If timer is actively running it will use Clock::now() as the end time
Definition at line 43 of file stopwatch.cpp.
| double tesseract_common::Stopwatch::elapsedSeconds | ( | ) | const |
Get the elapsed time in seconds.
If timer is actively running it will use Clock::now() as the end time
Definition at line 51 of file stopwatch.cpp.
| void tesseract_common::Stopwatch::start | ( | ) |
Start the timer.
Definition at line 31 of file stopwatch.cpp.
| void tesseract_common::Stopwatch::stop | ( | ) |
Stop the timer.
Definition at line 37 of file stopwatch.cpp.
|
private |
Definition at line 64 of file stopwatch.h.
|
private |
Definition at line 65 of file stopwatch.h.
|
private |
Definition at line 63 of file stopwatch.h.