Skip to content

Commit

Permalink
fix pause button in uptime bench
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 31, 2016
1 parent dfd309e commit 45e1ffd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions benchmarks/uptime/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h2>Biggest Streak: {{maxStreak}}</h2>
if (this.playing) {
update()
} else {
cancelAnimationFrame(loop)
clearTimeout(timeoutId)
}
}
}
Expand All @@ -183,15 +183,15 @@ <h2>Biggest Streak: {{maxStreak}}</h2>
}
}

var loop
var timeoutId
var lastFrame = null
function update () {
var thisFrame = window.performance.now()
if (lastFrame) {
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>
Expand Down

0 comments on commit 45e1ffd

Please sign in to comment.