Well cron is simpler than your example in the sense that there is no "speed". cron timers just use whatever dt you pass them. You can still do do timer:update(2*dt) to make a timer go twice as faster or timer:update(0.5*dt) to make it go twice as slow.Zilarrezko wrote:I'm sure kikito's library compensates for these things. He and/or she thinks of everything.
cron.lua does handle a different kind of "spill". If your dt is big enough, periodic timers get executed as many times as necessary, instead of once, which is the "naive" implementation (here's the spec for that, in case you are curious). The trick is using a "while" instead of an "if" to gradually remove dt "in steps" when it is greater than the frequency.