mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
24 lines
427 B
TypeScript
24 lines
427 B
TypeScript
const stats = new Stats();
|
|
stats.showPanel( 1 ); // 0: fps, 1: ms, 2: mb, 3+: custom
|
|
document.body.appendChild( stats.dom );
|
|
|
|
const panel = stats.addPanel(
|
|
new Stats.Panel('custom', 'red', 'pink'));
|
|
|
|
function animate() {
|
|
|
|
stats.begin();
|
|
|
|
// monitored code goes here
|
|
|
|
// $ExpectType number
|
|
stats.end();
|
|
|
|
panel.update(40, 100);
|
|
|
|
requestAnimationFrame( animate );
|
|
|
|
}
|
|
|
|
requestAnimationFrame( animate );
|