diff options
| author | iamcheeseman <[email protected]> | 2026-05-09 14:27:49 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-09 14:27:49 -0400 |
| commit | 59c2b995c611fc729aa74b0d3d67a5a8f345f22b (patch) | |
| tree | 16ae9b3caccc872eee238c5e7adf0eaf63617b89 /teensy/context.c | |
| parent | 71c9d121fef8d1c5f5f20ff1458551dc2953ab40 (diff) | |
add ty_sleep
Diffstat (limited to 'teensy/context.c')
| -rw-r--r-- | teensy/context.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/teensy/context.c b/teensy/context.c index 7095fe3..060254c 100644 --- a/teensy/context.c +++ b/teensy/context.c @@ -2,6 +2,7 @@ #include "renderer.h" #include <math.h> +#include <time.h> #include "platform.h" @@ -49,3 +50,12 @@ int ty_tick(void) } return tics; } + +// TODO: Find a better place for this +void ty_sleep(uint64_t ms) +{ + struct timespec ts; + ts.tv_sec = ms / 1000; + ts.tv_nsec = (ms % 1000) * 1000000; + nanosleep(&ts, NULL); +} |
