For my site i put it a line in on the page that says how long the page took to load. It's working fine (displaying the time and everything) the problem is though, i get a:
Notice: Undefined variable: time in mainfile.php on line 80
Here's some revalant code from mainfile.php:
function begintime() {
$time = round(microtime(), 3);
}
/* .... Code in here
*/
function footer() {
$time2 = round(microtime(), 3);
$generation = $time2 - $time; // <-- THIS IS LINE 80
/* .... More Function code here....
*/
echo "<font face='$face' size='2' color='$shadow'>This Page Took: " . $generation . " seconds to load</font>\n";
}
Here's some code in index.php:
global $time, $time2, $generation;
begintime();
footer();
and on the page, right where i want it it says: This Page Took: 0.198 seconds to load
I just keep getting that notice that I have an undefined variable time, does anyone see where that could be coming from?
Thanks,
Jim