From 21eb7b3790b843b7e4db6c2ac2acedbb5c78eee5 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 15 Jun 2025 23:43:03 -0400 Subject: block until whatever program is writing the file finishes --- os.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'os.h') diff --git a/os.h b/os.h index 23e94f2..b0be1c2 100644 --- a/os.h +++ b/os.h @@ -85,6 +85,11 @@ static double time_get_seconds(void) { + (double)t.tv_nsec * 1e-9; } +static void time_sleep_ms(double ms) { + if (ms <= 0) return; + time_sleep_ns((u64)(ms * 1000000)); +} + /// sleep for seconds static void time_sleep_seconds(double s) { if (s <= 0) return; -- cgit v1.2.3