#include <nap/timer.h>
Public Member Functions | |
Timer ()=default | |
virtual | ~Timer ()=default |
void | start () |
std::chrono::time_point< Clock > | getStartTime () const |
void | stop () |
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 |
Utility function that casts this timer's duration to a duration of type T. Where T can be NanoSeconds, MicroSeconds, MilliSeconds etc.
double getElapsedTime |
float getElapsedTimeFloat |
Hours getHours | ( | ) | const |
MicroSeconds getMicros | ( | ) | const |
Milliseconds getMillis | ( | ) | const |
Minutes getMinutes | ( | ) | const |
NanoSeconds getNanos | ( | ) | const |
Seconds getSeconds | ( | ) | const |
std::chrono::time_point< Clock > getStartTime |
Returns the start time.
uint32_t getTicks |
void reset |
Resets the timer, essentially starting it again.
void start |
Start the timer
void stop |
Stops the timer, start time is set to 0.
This call is deprecated because setting the start time to 0 results in large time time deltas, depending on the clock that is used. This call therefore serves no purpose whatsoever and will be removed.