Portfolio
Scripts and Websites I've made using PHP and MySQL mainly.
Snippets
Code snippets and mini tutorials
Contact
Contact me if you have any questions or queries
Home / Snippets / get_page_load_time
This section is new and undergoing snippet addition, as of 13/6/11
Will output something like: "This page took 0.999542 seconds to load"
This section is new and undergoing snippet addition, as of 13/6/11
Get Page Load Time
// Put this at the top of the page
$start = explode(" ", microtime());
$start = $start[1] + $start[0];
/* The rest Of Your Code Goes Here */
// E.g.
sleep(1);
/* End of Rest Of Your Code */
// Put this at the bottom of the page
$finish = explode(" ", microtime());
$finish = $finish[1] + $finish[0];
$total = $finish - $start;
printf("This page took %f seconds to load", $total);
Will output something like: "This page took 0.999542 seconds to load"
Comments
No Comments Have Been Made


