stats.js
JavaScript Performance Monitor
Last updated 9 years ago by mrdoob .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stats.js 
SYNC missed versions from official npm registry.

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='//rawgit.com/mrdoob/stats.js/master/build/stats.min.js';document.head.appendChild(script);})()

Current Tags

  • 0.17.0                                ...           latest (9 years ago)

6 Versions

  • 0.17.0                                ...           9 years ago
  • 0.16.0                                ...           10 years ago
  • 0.0.16                                ...           10 years ago
  • 0.0.14-master                                ...           11 years ago
  • 0.0.14                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 4
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)
Dependents (3)

Copyright 2013 - present © cnpmjs.org | Home |