Make clock.c atomic

This commit is contained in:
2026-10-18 21:15:35 +02:00
parent 8aad7c5023
commit 32f1ff25f7
2 changed files with 29 additions and 28 deletions
+5
View File
@@ -5,6 +5,7 @@
struct clock {
const char* name;
uint8_t priority;
uint64_t base;
void (*reset)(struct clock* c);
uint64_t (*get_elapsed_ns)(struct clock* c);
@@ -19,5 +20,9 @@ bool clock_available();
// Gets the current timestamp in nanoseconds since the last reset.
uint64_t clock_get_elapsed_ns();
uint64_t clock_get_realtime_ns();
void clock_set_realtime_ns(uint64_t ns);
// Spin for `ns` nanoseconds.
void clock_spin_ns(uint64_t ns);