diff options
| author | nasr <nsrddyn@gmail.com> | 2026-04-16 17:10:02 +0200 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-04-16 17:10:02 +0200 |
| commit | 8ea6a3c8621287d11296b8300029f32a27743d9a (patch) | |
| tree | cd12aa5fcd3e058fa74b45705c7b82524658d444 /source/base/base_platform.h | |
| parent | f430bfe8f71430032bec689bf0bbdc94ac409c22 (diff) | |
feature(checkpoint): checkpoint cleaning up base library
Diffstat (limited to 'source/base/base_platform.h')
| -rw-r--r-- | source/base/base_platform.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ | |||
| 1 | #ifndef BASE_PLATFORM_H | ||
| 2 | #define BASE_PLATFORM_H | ||
| 3 | |||
| 4 | #ifdef BASE_PLATFORM_IMPLEMENTATION | ||
| 5 | internal inline void | ||
| 6 | sleep_ms(long ms) | ||
| 7 | { | ||
| 8 | struct timespec ts; | ||
| 9 | ts.tv_sec = ms / 1000; | ||
| 10 | ts.tv_nsec = (ms % 1000) * 1000000L; | ||
| 11 | |||
| 12 | while (nanosleep(&ts, &ts)) | ||
| 13 | { | ||
| 14 | NULL; | ||
| 15 | } | ||
| 16 | } | ||
| 17 | #endif /* BASE_PLATFORM_IMPLEMENTATION */ | ||
| 18 | #endif /* BASE_PLATFORM_H */ | ||
