Speeduino
Loading...
Searching...
No Matches
elapsed_time.h
Go to the documentation of this file.
1#pragma once
2
21#include <stdint.h>
22
33static inline uint32_t timeElapsed(uint32_t now, uint32_t start) {
34 return now - start;
35}
36
50 return timeElapsed(now, start) >= interval;
51}
static uint32_t timeElapsed(uint32_t now, uint32_t start)
Compute the number of counter ticks elapsed from start to now.
Definition elapsed_time.h:33
static bool hasIntervalElapsed(uint32_t now, uint32_t start, uint32_t interval)
Check whether at least interval counter ticks have elapsed since start.
Definition elapsed_time.h:49
Definition array.h:14