Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
To calculate page loading start time and complete load end time using some script or something like this in IE 8 ...
Posted

1 solution

Here, it explains the logic of what you are trying to do: Page loading time script[^]

Something like:
Copy and paste the code below after <head> in a script tag
JavaScript
var d = new Date();
var starttime = d.getTime(); //Get the start time

Now find and paste this code before </body> in a script tag
JavaScript
var d2 = new Date();
var endtime = d2.getTime(); //Get the end time
//Find the difference between the start and end times
var totaltime = (endtime - starttime)/1000;
//Round 2 decimal places
var result = Math.round(totaltime*100)/100;
//Output results to a "P" element
document.getElementById("loadtime").innerHTML = "Page loading time: "+ result +" seconds";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900