patch for windows to get the cpu usage down.. i hope this s_delay (int ms) function works now

origin
stpohle 23 years ago
parent 673fcfc32d
commit 8857dafa2f

@ -1,4 +1,4 @@
/* $Id: sysfunc.c,v 1.13 2003/05/08 00:08:18 stpohle Exp $ /* $Id: sysfunc.c,v 1.14 2003/05/19 21:55:55 stpohle Exp $
sysfunc.c - this file hold some routines for the system functions.. sysfunc.c - this file hold some routines for the system functions..
like d_delay like d_delay
*/ */
@ -12,6 +12,10 @@
void void
s_delay (int ms) s_delay (int ms)
{ {
#ifdef _WIN32
sleep (ms); /* i hope this works on windows.. on MSVC it
should but with MINGW i don't know yet */
#else
fd_set selectset; fd_set selectset;
struct timeval tval; struct timeval tval;
@ -19,6 +23,7 @@ s_delay (int ms)
tval.tv_sec = 0; tval.tv_sec = 0;
tval.tv_usec = ms * 1000; tval.tv_usec = ms * 1000;
select (1, &selectset, NULL, NULL, &tval); select (1, &selectset, NULL, NULL, &tval);
#endif
}; };

Loading…
Cancel
Save