Page load timer
Description
Have you ever wanted a script that counts how long it takes for your webpage to load? Like the one when you google search and it says (X seconds)? Check out the quick tutorial below.
Set up
Put this code below your
- Code:
<script language="Javascript">
beforeload = (new Date()).getTime();
function pageloadingtime()
{
afterload = (new Date()).getTime();
secondes = (afterload-beforeload)/1000;
window.status='The page took [' + secondes + '] seconds to load.';
document.getElementById("loadingtime").innerHTML = "<font style='color:red;'>The page took [<b>" + secondes + "</b>] seconds to load.</font>";
}
window.onload = pageloadingtime;
</script>
Put this code where you want the text/stat to show up:
Code:
- Code:
<font id="loadingtime"></font>
Technical problems
![]() | The tutorial was tested on this forum and with the browser Google Chrome; If you notice that the tutorial doesn't work for a browser or for a version of forum (PhpBB2, PhpBB3, PunBB, Invision) contact an administrator and we will fill this field with your reporting. Thanks, the staff |
![]() | For every problem or question please, contact us in the section Support for the tutorials, The staff will answer you as soon as it is possible... |