Thread: Alarm
View Single Post
Old 05-05-2003, 12:53 AM   #4 (permalink)
ender
Code Monkey
 
ender's Avatar
 
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
ender is on a distinguished road
Send a message via AIM to ender Send a message via Yahoo to ender
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();
ender is offline   Reply With Quote