Page took .... seconds

liunx

Guest
I am looking for "This Page took .... seconds" HTML code. Can anyone help?<br />
Thanks<br />
Adam<!--content-->only with serverside language like php, cgi, asp. html can't do it.<!--content-->Yeah sure will, here is the PHP code if your interested...<br />
<br />
Place At Top Of Page<br />
<br />
<?<br />
$m_time = explode(" ",microtime()); <br />
$m_time = $m_time[0] + $m_time[1]; <br />
$starttime = $m_time;<br />
?><br />
<br />
Place Where You Want To Output<br />
<br />
<?<br />
$round = 3;// The number of decimal places to round the micro time to.<br />
$m_time = explode(" ",microtime()); <br />
$m_time = $m_time[0] + $m_time[1]; <br />
$endtime = $m_time; <br />
$totaltime = ($endtime - $starttime); <br />
echo "Page loading took:". round($totaltime,$round) ." seconds"; <br />
?><!--content-->
 
Back
Top