From ff3d85cabbc3df422ed68fd5b16217d4dcaba49d Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 8 Apr 2026 13:00:51 +0200 Subject: Add time module Co-Authored-By: Claude Sonnet 4.6 --- include/time.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/time.h (limited to 'include/time.h') diff --git a/include/time.h b/include/time.h new file mode 100644 index 0000000..26bbf20 --- /dev/null +++ b/include/time.h @@ -0,0 +1,20 @@ +#pragma once + +#include "types.h" + +typedef struct { + u64 s; + u64 ns; +} Time; + +typedef struct { + u64 s; + u64 ns; +} Duration; + +Time Time_get(); +f32 Time_ms(Time time); +Duration Time_diff(Time end, Time start); +f32 Duration_ms(Duration duration); +Duration Duration_from_ms(f32 ms); +Duration Duration_diff(Duration a, Duration b); -- cgit v1.3