Hi Folks, I am trying to create a game in Drupal where I am creating multiple timer instances... http://api.drupal.org/api/function/timer_start/6 .. My question is can timer_stop can automatically do garbage collection? Line 196 of bootstrap.inc (that defines timer_stop) is
unset($timers[$name]['start']);
To put it in perspective, The maximum possible number of timers I can possibly run is (number of node ids) * (number of user ids) which is huge... There is a certain game (node) in which multiple users can participate. All users have to maximize the time they have control over the game which means every user has his/her individual timer running within the game... As the game is time limited (say runs for 5 hours), I'd want to destroy all timers in a node after the node expires but there is no function like timer_delete. What I anticipate is that when I scale up, these will be thousands of redundant variables hogging memory and slowing down the system!
I figured I can write a patch for bootstrap.inc to add a timer_delete function that simply calls a function like the one below and my problem will be solved. Is it advisable to do it this way?
unset($timers[$name]);
Comments
can u describe a little bit
can u describe a little bit of your game (and game structure) ?
i rounder if the timer function can help u.
good day.