insert the following code at the top of the PHP page
<?php
$starttime = microtime();
$startarray = explode(" ", $starttime);
$starttime = $startarray[1] + $startarray[0];
?>
also put the following code at the bottom of the page
<?php
$endtime = microtime();
$endarray = explode(" ", $endtime);
$endtime = $endarray[1] + $endarray[0];
$totaltime = $endtime - $starttime;
$totaltime = round($totaltime,10);
echo "Time To Load: ".$totaltime;
?>
Now when you access your webpage it will show the time taken to load.
For example :
Time To Load: 0.015601
No comments:
Post a Comment