A while back I launched WebSpeedTest.co.za which is just a little script to check how long it takes to load your website. It doesn’t take into account loading of all objects on the website, just the HTML.
Some of the code can be used in your PHP script to see how long it takes to load.
First what you do is add this at the very top of your script.
$time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time;
That will have recorded your start time in the variable $start.
Now, at the very end of your script add this in:
$time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4);
$total_time now contains the amount of seconds it took to run your script. This can be useful for debugging to check where you might have bottlenecks.

