2020-05-08 09:59:35 -05:00
|
|
|
window.requestAnimFrame = (function (callback) {
|
2017-07-28 18:40:07 +02:00
|
|
|
return (
|
|
|
|
window.requestAnimationFrame ||
|
2017-02-24 09:15:33 -05:00
|
|
|
window.webkitRequestAnimationFrame ||
|
|
|
|
window.mozRequestAnimationFrame ||
|
|
|
|
window.oRequestAnimationFrame ||
|
|
|
|
window.msRequestAnimationFrame ||
|
2020-05-08 09:59:35 -05:00
|
|
|
function (callback) {
|
2017-02-24 09:15:33 -05:00
|
|
|
window.setTimeout(callback, 1000 / 30);
|
2017-07-28 18:40:07 +02:00
|
|
|
}
|
|
|
|
);
|
2017-02-24 09:15:33 -05:00
|
|
|
})();
|
2013-12-28 13:52:03 -08:00
|
|
|
|
2017-02-24 09:15:33 -05:00
|
|
|
stats = new Stats();
|
|
|
|
stats.setMode(0);
|
|
|
|
stats.domElement.style.position = 'fixed';
|
|
|
|
stats.domElement.style.left = '0px';
|
|
|
|
stats.domElement.style.top = '0px';
|
|
|
|
document.body.appendChild(stats.domElement);
|
2013-12-28 13:52:03 -08:00
|
|
|
|
2017-02-24 09:15:33 -05:00
|
|
|
function setStats() {
|
|
|
|
stats.begin();
|
2020-05-08 09:59:35 -05:00
|
|
|
requestAnimFrame(function () {
|
2017-02-24 09:15:33 -05:00
|
|
|
stats.end();
|
|
|
|
setStats();
|
|
|
|
});
|
|
|
|
}
|
2013-12-28 13:52:03 -08:00
|
|
|
|
2017-02-24 09:15:33 -05:00
|
|
|
setStats();
|