shows the loading time of a page.
<?
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$time_start = getmicrotime();
// start page content
// this is dummy - content
for ($i=0; $i <1000; $i++){
}
// end page content
$time_end = getmicrotime();
$time = $time_end - $time_start;
$time = round($time,6);
echo "This page loaded in $time seconds.";
?>
<?
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$time_start = getmicrotime();
// start page content
// this is dummy - content
for ($i=0; $i <1000; $i++){
}
// end page content
$time_end = getmicrotime();
$time = $time_end - $time_start;
$time = round($time,6);
echo "This page loaded in $time seconds.";
?>
Comment