summaryrefslogtreecommitdiff
path: root/os.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-06-15 23:43:03 -0400
committerpommicket <pommicket@gmail.com>2025-06-15 23:43:23 -0400
commit21eb7b3790b843b7e4db6c2ac2acedbb5c78eee5 (patch)
tree6b33a98d0edbc0e4084a54056d5ae5a4b754f2ab /os.h
parent100a4286688d6627698f857333a37ddec1f12d4a (diff)
block until whatever program is writing the file finishes
Diffstat (limited to 'os.h')
-rw-r--r--os.h5
1 files changed, 5 insertions, 0 deletions
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;