»
EnglishFrenchVietnamese

Print - Time to Load Content - JavaScriptBank.com

Full version: jsB@nk » Utility » Time to Load Content
URL: https://www.javascriptbank.com/time-to-load-content.html

Time to Load Content © JavaScriptBank.comUse this JavaScript to show how long it takes a page to load. A timer starts when the page begins to parse and ends when it has completed loading all of the content.

Full version: jsB@nk » Utility » Time to Load Content
URL: https://www.javascriptbank.com/time-to-load-content.html



JavaScript
<script type="text/javascript"><!-- Begin/*Created by: Abraham Joffe :: http://www.abrahamjoffe.com.au/ */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;}var loopTime=setInterval("currentTime()",100);window.onload=function(){  clearTimeout(loopTime);}// End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<script type="text/javascript"><!-- Begin  document.write('This page took <span id="endTime"></span> seconds to load.');// End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->