// stats.js - http://github.com/mrdoob/stats.js var Stats=function(){function a(b,a,c){b=document.createElement(b);b.id=a;b.style.cssText=c;return b}var m=performance&&performance.now?performance.now.bind(performance):Date.now,k=m(),n=k,c=0,p=Infinity,q=0,d=0,r=Infinity,t=0,u=0,v=0,l=a("div","stats","width:80px;opacity:0.9;cursor:pointer");l.addEventListener("mousedown",function(b){b.preventDefault();z(++v%2)},!1);var e=a("div","fps","padding:0 0 3px 3px;text-align:left;background:#002");l.appendChild(e);var w=a("div","fpsText","color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"); w.innerHTML="FPS";e.appendChild(w);var f=a("div","fpsGraph","position:relative;width:74px;height:30px;background:#0ff");for(e.appendChild(f);74>f.children.length;){var x=a("span","","width:1px;height:30px;float:left;background:#113");f.appendChild(x)}var g=a("div","ms","padding:0 0 3px 3px;text-align:left;background:#020;display:none");l.appendChild(g);var y=a("div","msText","color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px");y.innerHTML="MS";g.appendChild(y); var h=a("div","msGraph","position:relative;width:74px;height:30px;background:#0f0");for(g.appendChild(h);74>h.children.length;)x=a("span","","width:1px;height:30px;float:left;background:#131"),h.appendChild(x);var z=function(b){v=b;switch(v){case 0:e.style.display="block";g.style.display="none";break;case 1:e.style.display="none",g.style.display="block"}};return{REVISION:13,domElement:l,setMode:z,begin:function(){k=m()},end:function(){var b=m();c=b-k;p=Math.min(p,c);q=Math.max(q,c);y.textContent= (c|0)+" MS ("+(p|0)+"-"+(q|0)+")";var a=Math.min(30,30-c/200*30);h.appendChild(h.firstChild).style.height=a+"px";u++;b>n+1E3&&(d=Math.round(1E3*u/(b-n)),r=Math.min(r,d),t=Math.max(t,d),w.textContent=d+" FPS ("+r+"-"+t+")",a=Math.min(30,30-d/100*30),f.appendChild(f.firstChild).style.height=a+"px",n=b,u=0);return b},update:function(){k=this.end()}}};"object"===typeof module&&(module.exports=Stats);