diff options
| author | nasr <nsrddyn@gmail.com> | 2026-03-13 22:31:21 +0100 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-03-13 22:31:21 +0100 |
| commit | 444bfa2f41143aff7490e4fa21565947565b7d30 (patch) | |
| tree | 696b06d40140c85805d171597e37deb8290ead73 /source/platform/platform.c | |
| parent | 3913d1778318cd0c6bfb871148d38abb33ec7fd3 (diff) | |
cleanup: generalisation
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 | } | ||
