Skip to content

Commit

Permalink
fix potentially lost timers
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Sep 18, 2023
1 parent 5eead7c commit daab51c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ function addTimer(fn, ms){
fn.time = timeToRun

if(nextTimer.time > timeToRun){
if(nextTimer !== EmptyTimer){
timers.add(nextTimer)
}
nextTimer = fn
if(nextTickTimer === null) {
nextTickTimer = setTimeout(executeTimerTick, 25, now + 25)
Expand Down

0 comments on commit daab51c

Please sign in to comment.