This one is a must for developers and system admins. You need to know how long your site takes to load. Nobody sticks around waiting for a site to load anymore – there’s way too much content out there for that. Use this script to find out if your site is taking too long, and if it is, fix it.

Insert this code snippet inside the <head> and </head> tags of your document:

$starttime = microtime();
$startarray = explode(" ", $starttime);
$starttime = $startarray[1] + $startarray[0];

Insert this code snippet directly before the closing </body> tag of your document:


$endtime = microtime();
$endarray = explode(" ", $endtime);
$endtime = $endarray[1] + $endarray[0];
$totaltime = $endtime - $starttime;
$totaltime = round($totaltime,10);
echo "Seconds To Load: ";
printf ("%fn", $totaltime);

do it  and have fun 🙂

If you enjoyed this article, Get email updates (It’s Free)

Karthikeyan KPHPdate,php,time
This one is a must for developers and system admins. You need to know how long your site takes to load. Nobody sticks around waiting for a site to load anymore – there’s way too much content out there for that. Use this script to find...