37 enum State :
char { STOPPED, RUNNING, PAUSED };
39 static Stopwatch::State state;
40 static uint32_t accumulator;
41 static uint32_t startTimestamp;
42 static uint32_t stopTimestamp;
57 static bool abort() {
return stop(); }
79 static void resume(
const uint32_t with_time);
92 FORCE_INLINE
static bool isRunning() {
return state == RUNNING; }
99 FORCE_INLINE
static bool isPaused() {
return state == PAUSED; }
Stopwatch class.
Definition: stopwatch.h:35
static FORCE_INLINE void init()
Initialize the stopwatch.
Definition: stopwatch.h:48
static FORCE_INLINE bool isPaused()
Check if the timer is paused.
Definition: stopwatch.h:99
static void reset()
Reset the stopwatch.
Definition: stopwatch.cpp:73
static bool start()
Start the stopwatch.
Definition: stopwatch.cpp:56
static FORCE_INLINE bool isRunning()
Check if the timer is running.
Definition: stopwatch.h:92
static void resume(const uint32_t with_time)
Resume the stopwatch.
Definition: stopwatch.cpp:68
static bool stop()
Stop the stopwatch.
Definition: stopwatch.cpp:38
static uint32_t duration()
Get the running time.
Definition: stopwatch.cpp:80
static bool pause()
Pause the stopwatch.
Definition: stopwatch.cpp:47