Click to See Complete Forum and Search --> : Multiple timers?


bsamuels
11-16-2003, 12:15 AM
I have a school project writing a simple curses based video game with a ball controlled on the horizontal and verticle by some key input. At random intervals a target X is to appear . I use SIGALRM for the ball movement and am wondering how to make the X appear without using a seperate process. Any suggestions?

tecknophreak
11-16-2003, 12:56 PM
Why don't you use the same timer for both?
Just make the time that you will show the X based on how many SIGALRMs you have recieved. OR use setitimer (man setitimer) with ITIMER_REAL and ITIMER_VIRTUAL. It won't be as clean as the first suggestion, but it'll work.