I have seen it on many sites now and since I have been using PHP for so long and done
a huge amount of coding with it I thought it would add a nice touch and it could be
used for statistical purposes to assist me in database effeciency and so forth.
The idea is a page execution timer.. or a
Easy,
Put a code to the beginning of the page that takes the unix time stamp,
and another one to the end. The difference is the execution time at the
server side...
-=[ Julien Bonastre ]=- wrote:
I have seen it on many sites now and since I have been using PHP for so long and done
a huge
on 20/09/02 12:03 AM, WEB MASTER ([EMAIL PROTECTED]) wrote:
Easy,
Put a code to the beginning of the page that takes the unix time stamp,
and another one to the end. The difference is the execution time at the
server side...
microtime workds better, because most pages execute in under a
on 19/09/02 11:37 PM, -=[ Julien Bonastre ]=- ([EMAIL PROTECTED])
wrote:
I just want to know what function or module covers this feature.. If it is at
all possible..
Top of your script:
?
$timerOn = 1; // set to 0 if you want to turn it off
$timestart = getmicrotime();
?
Bottom:
?
Here is a function I sometimes use to log that will show you the time
that has passed since the last log entry. I find it very useful, so that
you can test a section of code's execution time simply by surrounding it
with calls to this function.
Maybe it will be useful to you.
Chris
function
This function:
function getmicrotime()
{
list($usec, $sec) = explode( ,microtime());
return ((float)$usec + (float)$sec);
}
is provided on this page:
http://www.php.net/manual/en/function.microtime.php
and is needed for the code below to work properly.
Beau
?
$timerOn = 1; //
6 matches
Mail list logo