diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-04-08 13:00:51 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-04-08 13:00:51 +0200 |
| commit | ff3d85cabbc3df422ed68fd5b16217d4dcaba49d (patch) | |
| tree | 12d792c07ad9d779f1b4ecf4ac785ad1a1082973 /include/time.h | |
| parent | 5babc34721e5f587ecae5bd4432fd57bf8c401fe (diff) | |
Add time module
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'include/time.h')
| -rw-r--r-- | include/time.h | 20 |
1 files changed, 20 insertions, 0 deletions
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); |
