diff --git a/source/build/include/sdlayer.h b/source/build/include/sdlayer.h index ae2cfe792..14ad4354b 100644 --- a/source/build/include/sdlayer.h +++ b/source/build/include/sdlayer.h @@ -92,10 +92,11 @@ static inline void idle_waitevent(void) static inline void idle(int const msec = 1) { -#ifndef _WIN32 - usleep(msec * 1000); -#else +#ifdef _WIN32 Sleep(msec); +#else + timespec const req = { 0, msec * 1000000 }; + do { } while (nanosleep(&req, &req)); #endif }