Want to measure and display a fair calculation of how long does your server/site took to load certain page? First, put this function on the very top of your page;
1
2
3
4
5
6
7
8 <?php
function loadTimeBegin() {
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
return $time;
}
?>
Then, just put this bit of codes at the very end of your page or contents;
1
2
3
4
5
6
7
8
9
10 <?php
function loadTimeEnd() {
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
return $time;
}
$total_loading_time = round((loadTimeEnd()- loadTimeBegin()), 4);
echo '<p>Page loaded in '.$total_loading_time.' seconds.'."\n";
?>
Walla~!
Comment?
»
Leave a comment

ajwa . Naj . Wawa . 27 . 











