How could I measure the time taken to load a page (with various different PHP statements)?
Somewhat like the stats available here - http://talks.php.net/show/drupal08/24
There are many ways to do this. I've personally been a fan of using microtime in the following way:
// Start of code
$time = microtime(true); // Gets microseconds
// Rest of code
// End of code
echo "Time Elapsed: ".(microtime(true) - $time)."s";
That will give you microsecond accuracy.
If you are writing command-line scripts (like Facebook puzzles), you can use just time.
time php dancebattle.php ~/input.dat
Win
real 0m0.152s
user 0m0.142s
sys 0m0.012s
I forgot about the method of monitoring page load times (from a browser). You can use the NET tab from Firebug (for Firefox) to do just that. It will let you watch the various file loads (AJAX, JS, CSS, Images, etc.).