mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 09:43:51 +08:00
6 lines
230 B
C
6 lines
230 B
C
|
|
// compute the time elapsed (in microseconds) from 2 counter samples
|
||
|
|
// case where ts < ts_last is ok: overflow is properly re-casted into uint32_t
|
||
|
|
uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last) {
|
||
|
|
return ts - ts_last;
|
||
|
|
}
|