git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3847
d7cf8633-e32d-0410-b094-
e92efae38249
MSG_WriteChar(&msg, svc_nop);
NetConn_SendUnreliableMessage(cls.netcon, &msg);
// try not to utterly crush the computer with work, that's just rude
- Sys_Sleep();
+ Sys_Sleep(1);
}
}
{
// don't totally hog the CPU
if (timeleft >= 0.02)
- Sys_Sleep();
+ Sys_Sleep(timeleft * 1000 - 5);
return false;
}
}
char *Sys_ConsoleInput (void);
-void Sys_Sleep (void);
+void Sys_Sleep(int milliseconds);
// called to yield for a little bit so as
// not to hog cpu when paused or debugging
return NULL;
}
-void Sys_Sleep(void)
+void Sys_Sleep(int milliseconds)
{
+ if (milliseconds < 1)
+ milliseconds = 1;
#ifdef WIN32
- Sleep (1);
+ Sleep(milliseconds);
#else
- usleep(1);
+ usleep(milliseconds * 1000);
#endif
}
return NULL;
}
-void Sys_Sleep(void)
+void Sys_Sleep(int milliseconds)
{
-#ifdef WIN32
- Sleep (1);
-#else
- usleep(1);
-#endif
+ if (milliseconds < 1)
+ milliseconds = 1;
+ SDL_Delay(milliseconds);
}
int SDL_main (int argc, char *argv[])
return NULL;
}
-void Sys_Sleep (void)
+void Sys_Sleep(int milliseconds)
{
- Sleep (1);
+ if (milliseconds < 1)
+ milliseconds = 1;
+ Sleep(milliseconds);
}