| the MasterTimer class is (or should be) an "invisible" class for the application. It only cares of managing the timers' tick times. Internally it stores each timer in a TimerEntry structure that holds a pointer to the timer itself, and the absolute time it will tick. All these TimerEntry instances go into an ordered priority queue, which means only (n+1) checks are made each frame, where n is the number of timer for which the countdown is elapsed. So no matter how many timers that are currently running. More...
|