Tizag.com Webmaster Tutorials - A collection of webmaster tutorials from HTML to PHP.

Wednesday, August 6, 2008

Page rendering time in PHP

function utime(){
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
return $sec + $usec;
}

/*...........on the top of the page................*/
$start = utime();

/*..........bottom of the page before the bolo.......*/
$end = utime();
$run = $end - $start;
echo "<!--

Page created in: " .
substr($run, 0, 5) . " seconds.

-->";

No comments: