Page 1 of 1
[SOLVED] how to show page generation time
Posted: Mon Dec 15, 2003 5:48 pm
by dull1554
i was wondering how to display page generation time
ex....
Code: Select all
this page was generated in 0.0083 seconds
something like that
i've looked on google and i cant find what i'm looking for, so i thought i'd try here, as always any help would be greatly appreciated.
Posted: Mon Dec 15, 2003 5:56 pm
by uberpolak
Check this out, it's a bit lengthy, but I think it's exactly what you're looking for.
http://www.webclass.ru/tut.php?tut=137
Posted: Mon Dec 15, 2003 5:59 pm
by dull1554
thats exactly what i wanted, thans a bunch, as i've said before fastest forum ever!!!!!!!!!!!!!!!!!!!
Posted: Mon Dec 15, 2003 6:04 pm
by uberpolak
Meh, I work for the government now... Have to kill time on the job somehow.
Posted: Mon Dec 15, 2003 6:05 pm
by dull1554
this is the code that i found to do what i want
Code: Select all
//Get current time as we did at start
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
//Store end time in a variable
$tend = $mtime;
//Calculate the difference
$totaltime = ($tend - $tstart);
//Output result
printf ("Page was generated in %f seconds !", $totaltime);
but there is a undefined $var, $tstart, i tried just changing it to $mtime, but that did not work either can someone tell me what i did wrong
Posted: Mon Dec 15, 2003 6:07 pm
by dull1554
sorry i found my mistake, i was being stupid and i left out part of the code
Posted: Mon Dec 15, 2003 6:09 pm
by dull1554
<h1>SOLVED</h1>