Home > PHP > How to check execution time of a page

How to check execution time of a page

Code:

// Add this in top of the script

$page_start_time = microtime(true);

 

// Add this in top of the script

if($page_start_time != 0){

       $page_end_time = microtime(true);

$differ = number_format($page_end_time - $page_start_time , 4);

echo “Page Load Time:  ”.$differ.” Seconds”;

}

Author: gaurav Categories: PHP Tags:
  1. No comments yet.
  1. No trackbacks yet.
Site is Under Construction