Skip to content
JavaScript Performance Monitor
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build Reverted package.json changes. Nov 5, 2016
examples Updated examples. Apr 11, 2016
files Clean up. Apr 11, 2016
src 1 second is inclusive in fps (#79) Jul 26, 2017
utils/compiler Updated closure compiler. Oct 29, 2016
.gitignore
LICENSE
README.md README: Updated bookmarklet Nov 15, 2018
bower.json
package.json
rollup.config.js Converted to module (#72) Oct 29, 2016

README.md

stats.js

JavaScript Performance Monitor

This class provides a simple info box that will help you monitor your code performance.

  • FPS Frames rendered in the last second. The higher the number the better.
  • MS Milliseconds needed to render a frame. The lower the number the better.
  • MB MBytes of allocated memory. (Run Chrome with --enable-precise-memory-info)
  • CUSTOM User-defined panel support.

Screenshots

fps.png ms.png mb.png custom.png

Usage

var stats = new Stats();
stats.showPanel( 1 ); // 0: fps, 1: ms, 2: mb, 3+: custom
document.body.appendChild( stats.dom );

function animate() {

	stats.begin();

	// monitored code goes here

	stats.end();

	requestAnimationFrame( animate );

}

requestAnimationFrame( animate );

Bookmarklet

You can add this code to any page using the following bookmarklet:

javascript:(function(){var script=document.createElement('script');script.onload=function(){var stats=new Stats();document.body.appendChild(stats.dom);requestAnimationFrame(function loop(){stats.update();requestAnimationFrame(loop)});};script.src='//mrdoob.github.io/stats.js/build/stats.min.js';document.head.appendChild(script);})()
You can’t perform that action at this time.