This is a animation performance measure meter inspired by mrdoob's stats.js. In addition to FPS, this project added CPU usage measure so you can know about your efficiency or potentiality of your animated program.
var clipMeter = new ClipMeter();
function tick() {
clipMeter.start();
for (var i = 0; i < 1e6; i++)
i = i + 1;
clipMeter.tick();
setTimeout(tick, 1000 / 60);
}
tick();
constructor options
align
: position of the meter, chossen from"left"
or"right"
width
: width of the meterheight
: height of the meteropacity
: opacity
public methods
start()
- record the start timetick()
- record the end time
MIT