Skip to content

Defs: timeout

This header provides an interface for simplistic timers used for timeout waiting. Currently they are based on the RTC with a resolution of 1/128 s.

static inline timeout_t timeout_make_ms(int ms) { return clock() + (int64_t)ms * CLOCKS_PER_SEC / 1000; }

static inline bool timeout_elapsed(timeout_t const *t) { return t && clock() >= *t; }
typedef clock_t timeout_t