fix pause button in uptime bench

This commit is contained in:
Evan You 2016-07-31 14:53:48 -04:00
parent dfd309ec84
commit 45e1ffd495

View File

@ -164,7 +164,7 @@
if (this.playing) {
update()
} else {
cancelAnimationFrame(loop)
clearTimeout(timeoutId)
}
}
}
@ -183,7 +183,7 @@
}
}
var loop
var timeoutId
var lastFrame = null
function update () {
var thisFrame = window.performance.now()
@ -191,7 +191,7 @@
app.fps = Math.round(fpsMeter.push(1000 / (thisFrame - lastFrame)))
}
app.servers = Object.freeze(generateServers())
loop = setTimeout(update, 0) // not using rAF because that limits us to 60fps!
timeoutId = setTimeout(update, 0) // not using rAF because that limits us to 60fps!
lastFrame = thisFrame
}
</script>