Adding float-no-zero branch hosted build

This commit is contained in:
ahocevar
2014-03-07 10:55:12 +01:00
parent 84cad42f6d
commit bd9092199b
1664 changed files with 731463 additions and 0 deletions
@@ -0,0 +1,39 @@
/**
* Display frame rate in a span element added to the navigation bar.
*/
(function() {
var container = document.querySelector('.navbar .navbar-inner .container');
if (!container) {
return;
}
if (!window.requestAnimationFrame) {
return;
}
var fpsElement = document.createElement('span');
fpsElement.style.color = 'white';
container.appendChild(fpsElement);
var frameCount = 0;
var begin = +new Date();
window.setInterval(function() {
var end = +new Date();
var milliseconds = end - begin;
var seconds = milliseconds / 1000.0;
var frameRate = frameCount / seconds;
fpsElement.innerHTML = frameRate.toPrecision(4) + ' fps';
frameCount = 0;
begin = end;
}, 500);
var go = function() {
frameCount++;
window.requestAnimationFrame(go);
};
go();
})();