FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!

Page load time




Outputs the time in seconds that it takes for a PHP page to load.


The code


Code:
<?php



// Insert this block of code at the very top of your page:



$time = microtime();

$time = explode(" ", $time);

$time = $time[1] + $time[0];

$start = $time;



// Place this part at the very end of your page



$time = microtime();

$time = explode(" ", $time);

$time = $time[1] + $time[0];

$finish = $time;

$totaltime = ($finish - $start);

printf ("This page took %f seconds to load.", $totaltime);



?>

Smile



0 blog comments below




FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.