added cache perf test. refactored Star.js to better incorporate getters

This commit is contained in:
Eric Rowell
2013-12-28 13:52:03 -08:00
parent b5165fa8fb
commit 264f24e241
5 changed files with 158 additions and 22 deletions

27
test/setStats.js Normal file
View File

@@ -0,0 +1,27 @@
window.requestAnimFrame = (function(callback){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback){
window.setTimeout(callback, 1000 / 30);
};
})();
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);
function setStats() {
stats.begin();
requestAnimFrame(function(){
stats.end();
setStats();
});
}
setStats();