Merge pull request #1285 from gregolai/master

first, small commit :) mrdoob's stats
This commit is contained in:
Basarat Ali Syed
2013-11-21 02:45:55 -08:00
2 changed files with 41 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
/// <reference path="stats.d.ts" />
var stats = new Stats();
stats.setMode(1); // 0: fps, 1: ms
// Align top-left
stats.domElement.style.position = 'absolute';
stats.domElement.style.left = '0px';
stats.domElement.style.top = '0px';
document.body.appendChild( stats.domElement );
setInterval( function () {
stats.begin();
// your code goes here
stats.end();
}, 1000 / 60 );
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for Stats.js r11
// Project: http://github.com/mrdoob/stats.js
// Definitions by: Gregory Dalton <https://github.com/gregolai>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class Stats {
REVISION: number;
domElement: HTMLDivElement;
// 0: fps, 1: ms
setMode(value: number): void;
begin(): void;
end(): number;
update(): void;
}