22 #ifndef ETCPAL_TIMER_H_
23 #define ETCPAL_TIMER_H_
112 #define ETCPAL_TIME_ELAPSED_SINCE(start_time) (uint32_t)(etcpal_getms() - (uint32_t)start_time)
uint32_t etcpal_timer_elapsed(const EtcPalTimer *timer)
Get the time since a timer was reset.
Definition: timer.c:56
void etcpal_timer_start(EtcPalTimer *timer, uint32_t interval)
Start a timer.
Definition: timer.c:30
uint32_t etcpal_timer_remaining(const EtcPalTimer *timer)
Get the amount of time remaining in a timer.
Definition: timer.c:87
struct EtcPalTimer EtcPalTimer
A millisecond-resolution timer.
bool etcpal_timer_is_expired(const EtcPalTimer *timer)
Check to see if a timer is expired.
Definition: timer.c:73
uint32_t etcpal_getms(void)
Get a monotonically-increasing millisecond value.
void etcpal_timer_reset(EtcPalTimer *timer)
Reset a timer while keeping the same interval.
Definition: timer.c:43
A millisecond-resolution timer.
Definition: timer.h:102
uint32_t reset_time
The time at which this timer was reset.
Definition: timer.h:103
uint32_t interval
This timer's timeout interval.
Definition: timer.h:104