![]() |
| Page Load Time Javascript |
| This Javascript code can be used to display the time to load the current page.
The initial script to set the start time goes as the first item in your page. The script to set the end time goes is at the bottom of your html code before the </body> tag. |
<script language="javascript" type="text/javascript">
var now = new Date();
var startTime = now.getTime()
</script>
<!-- <html>
...... put your code .....
</html>
//-->
<script language="javascript" type="text/javascript">
now = new Date();
var endTime = now.getTime();
alert("Time taken to load page : " + ((endTime - startTime)/1000)+" seconds");
</script>
|