Below code is the simple reference to measure code execution time. Sometimes, you may need to check Performance for optimization to reduce server cost. function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
// ----- starting point of measuring performance
// ----------------------------------------
$difftime = $time_end - $time_start;
$difftime = number_format($difftime,5);
echo <<< FOOT
<HR>
Processing Time : $difftime sec
FOOT;
Tags: PHP Title header performance measuring pragma
|