mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
20 lines
330 B
TypeScript
20 lines
330 B
TypeScript
/// <reference path="stats.d.ts" />
|
|
|
|
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 );
|