Skip to content

Generic Monotonic Timestamp

include/time/mono_time.h View source View on GitHub
struct mono_time (1 field) source
§ time_ns_t internal

We store the time in nanoseconds internally, however NOTE: DO NOT use this as a nanosecond counter, the idea of this struct is that it is a generic timestamp for easier cross-unit conversions

time_s_t mono_time_to_s(struct mono_time ts)
source
time_ms_t mono_time_to_ms(struct mono_time ts)
source
time_us_t mono_time_to_us(struct mono_time ts)
source
time_ns_t mono_time_to_ns(struct mono_time ts)
source
struct mono_time mono_time_from_s(time_s_t s)
source
struct mono_time mono_time_from_ms(time_ms_t ms)
source
struct mono_time mono_time_from_us(time_us_t us)
source
struct mono_time mono_time_from_ns(time_ns_t ns)
source
time_s_t mono_time_set_s(struct mono_time *ts, time_s_t s)
source

Returns the old value

time_ms_t mono_time_set_ms(struct mono_time *ts, time_ms_t ms)
source
time_us_t mono_time_set_us(struct mono_time *ts, time_us_t us)
source
time_ns_t mono_time_set_ns(struct mono_time *ts, time_ns_t ns)
source