>: Could you tell me how to sleep for 100 milliseconds
>: without staying in a loop. The normal sleep() function
>: will suspend the process for minimum of 1 sec.
>I saw a function called setitimer() on several systems. This functions allows
>you to set the resolution for calls like sleep().
Uh, I don't think so. But, the timers useable by setitimer() can be set for
100 millisecond intervals. Plus, a signal is generated when the particular
timer (you have 3 to choose from) expires. Instead of looping you could just
wait for the signal to occur. If no other signals are being delivered the
wait() call could be easily used for this purpose. Otherwise you'll want to
use the sigpause() call to only wake up when a certain signal is delivered.
Keep in mind that the actual time required to notify a process of a timer
expiring is dependant on the system load.