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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?