Use nanosleep instead of usleep

git-svn-id: https://svn.eduke32.com/eduke32@8168 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-10-19 23:43:30 +00:00 committed by Christoph Oelckers
parent ad6d94b0f5
commit 91fde580ce

View file

@ -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
}