From 59c2b995c611fc729aa74b0d3d67a5a8f345f22b Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Sat, 9 May 2026 14:27:49 -0400 Subject: add ty_sleep --- teensy/context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'teensy') 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 +#include #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); +} -- cgit v1.3-2-g0d8e