Screen Shot for Thumnbails


Conn Warwicker



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

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"

Leave a Comment


Comment

All fields are required

Your Name


Your Email Address


Your Comment


Human Validation

What animal is this above:






Comments


No Comments Have Been Made