stats.js

JavaScript性能监视器。「JavaScript Performance Monitor

Github星跟踪图

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

主要指标

概览
名称与所有者mrdoob/stats.js
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台Cross-platform, Web browsers
许可证MIT License
所有者活动
创建于2010-04-08 11:54:17
推送于2024-10-11 03:59:02
最后一次提交2024-10-11 12:58:54
发布数16
最新版本名称r17 (发布于 2016-10-28 18:18:23)
第一版名称r6 (发布于 )
用户参与
星数8.9k
关注者数182
派生数1.2k
提交数148
已启用问题?
问题数0
打开的问题数0
拉请求数23
打开的拉请求数16
关闭的拉请求数30
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?