Timing Page Loads

A

Anonymous

Guest
Hello again guys.

New hour - new project (well, mini project).

I'd like to monitor how long pages take to load - is there an easy way to do this...?

I use generic headers and footers accross the entire site so I could insert some code into these and time how long they take but just wondered what is the best way of doing this because I am sure others have done this before me.
 
Code:
$start_time = microtime();
header();

//code for page

//footer
$end_time = microtime();

echo "This page took ". $end_time - $start_time > " to generate.";
 
Back
Top