Calculating execution time in PHP
Calculating the execution time is very simple in PHP
using the time function we can get the script execution time
easily and exactly.
The below code will help to find execution time.
<?php
function current_time()
{
$time = microtime();
$time = explode(" ",$time);
$time = $time[1] + $time[0];
return $time;
}
$starttime = current_time();
/**************
Do your code here
********************/
$endtime = current_time();
$totaltime = ($endtime - $starttime);
echo "This page was created in ".$totaltime." seconds";
;?>
