Subscribe For Free Updates!

We'll not spam mate! We promise.

Jul 8, 2013

PHP to Determine Page Execution Time

PHP to Determine Page Execution Time :


PHP to Determine Page Execution Time


The below code is used to find the php page execution time.


Just paste the below code in header portion in php page.

<?php 
   $time = microtime(); 
   $time = explode(" ",$time); 
   $time = $time[1] + $time[0]; 
   $starttime = $time; 
;?> 

after the above code you can add other html or php codes.

and paste the below code in footer page of same php file.

<?php 
   $time = microtime(); 
   $time = explode(" ",$time); 
   $time = $time[1] + $time[0]; 
   $endtime = $time; 
   $totaltime = ($endtime - $starttime); 
   echo "This page execution time is ".$totaltime." seconds"; 
;?>

TechniqZone Socializer Widget
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment