diff options
Diffstat (limited to 'source/platform/platform.c')
| -rw-r--r-- | source/platform/platform.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/platform/platform.c b/source/platform/platform.c new file mode 100644 index 0000000..2e7bbad --- /dev/null +++ b/source/platform/platform.c | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | internal inline void | ||
| 2 | sleep_ms(long ms) | ||
| 3 | { | ||
| 4 | struct timespec ts; | ||
| 5 | ts.tv_sec = ms / 1000; | ||
| 6 | ts.tv_nsec = (ms % 1000) * 1000000L; | ||
| 7 | |||
| 8 | while (nanosleep(&ts, &ts)) | ||
| 9 | { | ||
| 10 | NULL; | ||
| 11 | } | ||
| 12 | } | ||
