Display page load time in PHP


So in order to measure the page generation time add the following code to the beginning of your PHP code -

<?php

$start_time_page = microtime(TRUE);

?>



At the end of your PHP code add the following script -

<?php

$$end_time_page = microtime(TRUE);

$time_taken = $end_time_page - $start_time_page;

$time_taken = round($time_taken,3);

echo 'Page generated in '.$time_taken.' seconds.';

?>

Comments

Popular posts from this blog

How Understanding Cloud Computing Saved a Million Dollars!

Some mistakes to avoid while looking for a job