summaryrefslogtreecommitdiff
path: root/source/base/base_platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/base/base_platform.h')
-rw-r--r--source/base/base_platform.h18
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
5internal inline void
6sleep_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 */