Date: Fri, 18 Dec 1998 15:10:31 -0500 (EST) From: Daniel Reed To: djgpp AT delorie DOT com Subject: Re: [Re: cpu eater] In-Reply-To: <19981218134712.25514.qmail@www0s.netaddress.usa.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On 18 Dec 1998, ADAM SCHROTENBOER wrote: ) If you want to release the time slice, write your own sleep function. Okay... ) >I was expecting the program to sleep quietly for 5 secs and then ) >continue ) >the while(); #include int mysleep(int seconds) { struct timeval tv; tv.tv_sec = seconds; tv.tv_usec = 0; select(0, NULL, NULL, NULL, &tv); return(tv.tv_sec); } That should emulate sleep() pretty well. If the mysleep() call is interrupted during the select(), it'll return the number of seconds remaining in the sleep timeout, just like the standard sleep() does. -- Daniel Reed I'll never forget the first time I ran Windows, but I'm trying...