diff options
-rw-r--r-- | opentrack-compat/sleep.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/opentrack-compat/sleep.hpp b/opentrack-compat/sleep.hpp index 0a551dcc..d4956e79 100644 --- a/opentrack-compat/sleep.hpp +++ b/opentrack-compat/sleep.hpp @@ -1,20 +1,21 @@ #pragma once -namespace portable -{ #ifdef _WIN32 # include <windows.h> - +namespace portable +{ inline void sleep(unsigned milliseconds) { Sleep(milliseconds); } +} #else - #include <unistd.h> +# include <unistd.h> +namespace portable { inline void sleep(unsigned milliseconds) { usleep(milliseconds * 1000U); // takes microseconds } -#endif } +#endif |