|
Signals
Another thing you could do, supposing that your OS supports posix signals and such, is use signals to do it, you could set up your own signal handler and use the interval timer functions to set up your interval. That is how I would do it, then you don't have to do repetitive queries to time() or the like.
The signal is called SIGALRM, and the you can use either the alarm() function that works in seconds, or the setitimer() function which can work in microseconds.
Just a suggestion,
Ted Morse
__________________
while(1) fork();
|