From 8ea6a3c8621287d11296b8300029f32a27743d9a Mon Sep 17 00:00:00 2001 From: nasr Date: Thu, 16 Apr 2026 17:10:02 +0200 Subject: feature(checkpoint): checkpoint cleaning up base library --- source/base/base_platform.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 source/base/base_platform.h (limited to 'source/base/base_platform.h') diff --git a/source/base/base_platform.h b/source/base/base_platform.h new file mode 100644 index 0000000..91cd55d --- /dev/null +++ b/source/base/base_platform.h @@ -0,0 +1,18 @@ +#ifndef BASE_PLATFORM_H +#define BASE_PLATFORM_H + +#ifdef BASE_PLATFORM_IMPLEMENTATION +internal inline void +sleep_ms(long ms) +{ + struct timespec ts; + ts.tv_sec = ms / 1000; + ts.tv_nsec = (ms % 1000) * 1000000L; + + while (nanosleep(&ts, &ts)) + { + NULL; + } +} +#endif /* BASE_PLATFORM_IMPLEMENTATION */ +#endif /* BASE_PLATFORM_H */ -- cgit v1.3