- Joined
- Jul 10, 2007
- Messages
- 6,306
I really want to avoid a loop for this.
Any ideas?
This is for a timer system. When the timer expires, the trigger is evaluated for all of the code on it. If that timer was previous paused, then it moves to a different trigger on a resume call (within the trigger evaluation). If it is destroyed, it is removed from the trigger.
So what would be the best way to do this you think? The only way I can think of atm is a stack D: and a destroyed timer stack (they can't be recycled until they are removed from the trigger), which would incur a bit of extra overhead. I really want to avoid a loop if at all possible.
Another note. Trigger executes can't be used as they'd slow the resource down much more than a loop would.
If I can just solve this problem w/o a loop, this timer system will be way faster than regular timers : D.
Also, clearing the triggers conditions and then building it up is also a bad idea... that would be insanely slow, slower than looping through destroyed/moving timers.
Any ideas?
This is for a timer system. When the timer expires, the trigger is evaluated for all of the code on it. If that timer was previous paused, then it moves to a different trigger on a resume call (within the trigger evaluation). If it is destroyed, it is removed from the trigger.
So what would be the best way to do this you think? The only way I can think of atm is a stack D: and a destroyed timer stack (they can't be recycled until they are removed from the trigger), which would incur a bit of extra overhead. I really want to avoid a loop if at all possible.
Another note. Trigger executes can't be used as they'd slow the resource down much more than a loop would.
If I can just solve this problem w/o a loop, this timer system will be way faster than regular timers : D.
Also, clearing the triggers conditions and then building it up is also a bad idea... that would be insanely slow, slower than looping through destroyed/moving timers.