I'm not quite sure if this really works or not but I have made a script that does devinemke says
grab a microtime at the start of the page and another at the end of the page and compare.
I have added a loop in there because you will get scientific notation happening if the time is too fast/small
here it is
<?php
$start_time = microtime();
$i = 0;
while ($i < 5000) {
$i++;
}
$end_time = microtime();
$new_time = ("$end_time" - "$start_time");
echo "This page took $new_time to be generated";
?>