Time code execution with at least 1 us resolution. The time resolution can be stored up to .1 ns resolution, but is measured to the following accuracy:
#include <Timer.h>
Public Member Functions | |
| Timer () | |
| Default constructor. Initialize internal variables. It does NOT start timing. More... | |
| void | start () |
| Start the timer. More... | |
| void | restart () |
| Reset and start the timer. More... | |
| void | stop () |
| Stop the timer. It can be restarted afterward, adding time to what was already timed. More... | |
| void | reset () |
| Reset the timer to zero. More... | |
| double | getElapsed () const |
| Get total elapsed time. It returns the sum of all the elapsed time between all the start/stop sessions since the timer was created or the last call to reset. Time is in seconds with microsecond resolution. More... | |
Static Public Member Functions | |
| static long double | getCurrentTime () |
| Get the current time. More... | |
Protected Attributes | |
| long double | start_point |
| double | elapsed |
| bool | isRunning |
| mio::Timer::Timer | ( | ) |
Default constructor. Initialize internal variables. It does NOT start timing.
|
static |
Get the current time.
| double mio::Timer::getElapsed | ( | ) | const |
Get total elapsed time. It returns the sum of all the elapsed time between all the start/stop sessions since the timer was created or the last call to reset. Time is in seconds with microsecond resolution.
| void mio::Timer::reset | ( | ) |
Reset the timer to zero.
| void mio::Timer::restart | ( | ) |
Reset and start the timer.
| void mio::Timer::start | ( | ) |
Start the timer.
| void mio::Timer::stop | ( | ) |
Stop the timer. It can be restarted afterward, adding time to what was already timed.
|
protected |
|
protected |
|
protected |