urbanyoung / Phasor

Phasor is a server extension for Halo PC which focuses on giving the end-user the ability to deeply customize gameplay. Phasor does this via its scripting system, which uses the Lua language. Scripters are able to react to and change many different aspects of the game.
MIT License
19 stars 9 forks source link

Issues with Timers that take more time to execute than the delay. #69

Closed th3w1zard1 closed 9 years ago

th3w1zard1 commented 9 years ago

If a timer is called every 100ms, and an execution of the timer takes longer than the timer delay (150ms for example), Phasor will call the timer again before the first call is done executing, and that should not happen.

urbanyoung commented 9 years ago

Return false from the callback and re-register it before doing any processing.

function MyTimer()
    my_timer_id = registertimer(delay, "MyTimer")

    ... long operation ...

    return false
end