36#ifndef DETERMINISTICESPASYNCWEBSERVER_DET_CLOCK_H
37#define DETERMINISTICESPASYNCWEBSERVER_DET_CLOCK_H
55 static uint32_t div = 1;
95 static uint32_t div = 1;
176 if (budget_us && lat > budget_us)
uint32_t & _detws_micros_div_ref()
uint32_t & _detws_clock_div_ref()
uint32_t detws_millis(void)
The library's monotonic time at 1000 Hz (milliseconds).
void detws_set_micros_clock(detws_clock_fn fn, uint32_t ticks_per_second)
Install a custom microsecond clock running at ticks_per_second; the library divides it down to 1 MHz....
void detws_lat_reset(DetwsLatencyStat *s)
Zero a stat (min seeded high so the first sample sets it).
detws_clock_fn & _detws_clock_fn_ref()
uint32_t detws_lat_avg_us(const DetwsLatencyStat *s)
Mean latency (us) over the recorded samples, 0 if none.
uint32_t detws_micros(void)
Monotonic microseconds - the high-resolution time base for ISR timestamps and sub-millisecond latency...
uint32_t detws_lat_begin(void)
Start of a measured span: capture the current microsecond time.
void detws_lat_end(DetwsLatencyStat *s, uint32_t start_us, uint32_t budget_us)
End of a span started at start_us: record its latency, counting it as over-budget when budget_us is n...
detws_clock_fn & _detws_micros_fn_ref()
uint32_t(* detws_clock_fn)(void)
User clock: returns a free-running monotonic tick count.
void detws_set_clock(detws_clock_fn fn, uint32_t ticks_per_second)
Install a custom clock running at ticks_per_second; the library divides it down to its internal 1000 ...
Rolling latency statistics in microseconds: sample count, min / max / mean, and how many samples blew...
uint32_t over_budget
samples whose latency exceeded the budget