1 line
331 B
JavaScript
1 line
331 B
JavaScript
window.VT=window.VT||{},VT.AppFps=function(a){function b(){if(requestAnimationFrame(b),c.push(performance.now()),!(20>=c.length)){for(var d,e=1/0,f=0,g=0,h=1;21>h;++h)d=c[h]-c[h-1],e=Math.min(e,d),f=Math.max(f,d),g+=d;var j=1e3*(20/g);a.innerText=j.toFixed(0)+" fps ("+e.toFixed(0)+" ms - "+f.toFixed(0)+" ms)",c=[]}}var c=[];b()}; |