This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Measures framerate for the time between start() and stop() calls */ | |
function FramerateMeasurer () { | |
this.start = () => { | |
this._beginTime = ( performance || Date ).now() | |
this._frames = 0 | |
this._animationFrameId = requestAnimationFrame(this._loop) | |
} | |
this.stop = () => { | |
const endTime = ( performance || Date ).now() |