Get total execution time of any PHP Script.


Using this below script we can easily calculate execution time of php script.
$time_start = microtime(true);
 // Add script which time you want to calculate
$time_end = microtime(true);

//dividing with 60 will give the execution time in minutes other wise seconds
$execution_time = ($time_end - $time_start)/60;

//execution time of the script
echo 'Total Execution Time: '.$execution_time.' Mins';

Previous
Next Post »