Thursday, January 31, 2008

PHP: Calculate PHP Page Load Time

//put this at the start of your php script.
$s_mt = explode(" ",microtime());

//put this at the end of your php script
$e_mt = explode(" ",microtime());
$s = (($e_mt[1] + $e_mt[0]) - ($s_mt[1] + $s_mt[0]));
echo "Page created in ".$s." seconds";

No comments: