aboutsummaryrefslogtreecommitdiff
path: root/src/std/time.h
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-04-08 13:14:27 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-04-08 13:15:01 +0200
commitcf534d762754860ed5b714974f99acd282d48b3b (patch)
treebf22341cedfb50ee7bcd4e15f85add2329783f31 /src/std/time.h
parent630fcb1846aed16b9ab62bcf700f668883f4521f (diff)
Restructure into src/{std,json}/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/std/time.h')
-rw-r--r--src/std/time.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/std/time.h b/src/std/time.h
new file mode 100644
index 0000000..26bbf20
--- /dev/null
+++ b/src/std/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);