#include <nap/timer.h>
Public Member Functions | |
| Timer ()=default | |
| virtual | ~Timer ()=default |
| void | start () |
| void | start (std::chrono::time_point< Clock > time) |
| std::chrono::time_point< Clock > | getStartTime () const |
| void | reset () |
| double | getElapsedTime () const |
| float | getElapsedTimeFloat () const |
| uint32_t | getTicks () const |
| NanoSeconds | getNanos () const |
| MicroSeconds | getMicros () const |
| Milliseconds | getMillis () const |
| Seconds | getSeconds () const |
| Minutes | getMinutes () const |
| Hours | getHours () const |
| template<typename T > | |
| T | get () const |
Keeps track of time from the moment the timer is started. This is a template Timer that can work with various chrono clocks. Use the utility classes nap::SystemTimer and nap::HighResolutionTimer to work with specific clocks. The template type T should be a specific type of chrono clock, ie: HighResolutionClock etc. This timer is not threaded and doesn't work with callbacks.
|
default |
|
virtualdefault |
| T get | ( | ) | const |
Utility function that casts this timer's duration to a duration of type T. Where T can be NanoSeconds, MicroSeconds, MilliSeconds etc.
| double getElapsedTime | ( | ) | const |
| float getElapsedTimeFloat | ( | ) | const |
| Hours getHours | ( | ) | const |
| MicroSeconds getMicros | ( | ) | const |
| Milliseconds getMillis | ( | ) | const |
| Minutes getMinutes | ( | ) | const |
| NanoSeconds getNanos | ( | ) | const |
| Seconds getSeconds | ( | ) | const |
| std::chrono::time_point<Clock> getStartTime | ( | ) | const |
Returns the start time.
| uint32_t getTicks | ( | ) | const |
| void reset | ( | ) |
Resets the timer, essentially starting it again.
| void start | ( | ) |
Start the timer
| void start | ( | std::chrono::time_point< Clock > | time | ) |
Start timer at given time
| time | the start time |