Forum Load Time Indicator

MobileHacks

New Member
Well with this simple little hack that sits queitly at the bottom of your footer. A timer starts when the page begins to parse and ends when it has completed loading all of the content. The result is the time in seconds of how fast (or slow) your forums are loading.

choose the skin you want this showing and,

Insert this bottom of the header template:
PHP:
<script type="text/javascript">
<!-- Begin


var startTime=new Date();

function currentTime(){
  var a=Math.floor((new Date()-startTime)/100)/10;
  if (a%1==0) a+=".0";
  document.getElementById("endTime").innerHTML=a;
}

window.onload=function(){
  clearTimeout(loopTime);
}

// End -->
</script>
Insert this bit of code on the next line below the vb time code in footer template as i wanted it to show below the time but you can add it where you chose:

PHP:
<div class="smallfont" align="center"><b><script type="text/javascript">
<!-- Begin
  document.write('This Page took <span id="endTime">0.0</span> seconds to load.');
  var loopTime=setInterval("currentTime()",100);
// End -->
</script>
</b>
<br />
 
Back
Top