stats.js

JavaScript性能监视器。「JavaScript Performance Monitor

Github stars Tracking Chart

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

Installation

npm install stats.js

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);})()

Main metrics

Overview
Name With Ownermrdoob/stats.js
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
PlatformCross-platform, Web browsers
License:MIT License
所有者活动
Created At2010-04-08 11:54:17
Pushed At2024-10-11 03:59:02
Last Commit At2024-10-11 12:58:54
Release Count16
Last Release Namer17 (Posted on 2016-10-28 18:18:23)
First Release Namer6 (Posted on )
用户参与
Stargazers Count8.9k
Watchers Count182
Fork Count1.2k
Commits Count148
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count23
Pull Requests Open Count16
Pull Requests Close Count30
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private