diff options
Diffstat (limited to 'teensy')
| -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); +} |
