$starttime = microtime(true); // Top of page
// Code
$endtime = microtime(true); // Bottom of page
$time_taken =($endtime - $starttime)*1000;
$time_taken = round($time_taken,5); // 5 is nothing but Precision
print("Page loaded in seconds", $time_taken );
//Put this code at beginning of your page:
<?php $start_time = microtime(true); ?>
//Put this code at the end of your page:
This page was generated in <?php echo(number_format(microtime(true) - $start_time, 2)); ?> seconds.