Time for page
am 31.08.2007 09:04:54 von Sonnich Jensen
Hi!
Is there a timer for the page, so I can see how long it has taken for
process the page?
Say, the page opens,and at the buttom there is a text say "it took 4
hrs to process your request" :-)
BR
Sonnich
Re: Time for page
am 31.08.2007 09:16:08 von Alexander
On 31 Aug., 09:04, Sonnich Jensen
wrote:
> Hi!
>
> Is there a timer for the page, so I can see how long it has taken for
> process the page?
> Say, the page opens,and at the buttom there is a text say "it took 4
> hrs to process your request" :-)
>
> BR
> Sonnich
begin of page
$t1=time();
....end of page...
$t2=time();
$duration=$t2-t1;
echo "it took $duration millisecs";
?>
Re: Time for page
am 31.08.2007 11:07:48 von Erwin Moller
alexander@modelagentur.de wrote:
> On 31 Aug., 09:04, Sonnich Jensen
> wrote:
>> Hi!
>>
>> Is there a timer for the page, so I can see how long it has taken for
>> process the page?
>> Say, the page opens,and at the buttom there is a text say "it took 4
>> hrs to process your request" :-)
>>
>> BR
>> Sonnich
>
> begin of page
>
> $t1=time();
>
>
> ...end of page...
> $t2=time();
> $duration=$t2-t1;
> echo "it took $duration millisecs";
> ?>
>
(Small correction)
Alexander is right, but the samplecode is producing SECONDS, not millis.
time Return current Unix timestamp
Description
int time ( void )
Returns the current time measured in the number of seconds since the
Unix Epoch (January 1 1970 00:00:00 GMT).
If you want millis, use microtime:
microtime Return current Unix timestamp with microseconds
Regards,
Erwin Moller
Re: Time for page
am 31.08.2007 11:55:08 von Sonnich Jensen
On Aug 31, 12:07 pm, Erwin Moller
wrote:
> alexan...@modelagentur.de wrote:
> > On 31 Aug., 09:04, Sonnich Jensen
> > wrote:
> >> Hi!
>
> >> Is there a timer for the page, so I can see how long it has taken for
> >> process the page?
> >> Say, the page opens,and at the buttom there is a text say "it took 4
> >> hrs to process your request" :-)
>
> >> BR
> >> Sonnich
>
> > begin of page
> >
> > $t1=time();
>
> > ...end of page...
> > $t2=time();
> > $duration=$t2-t1;
> > echo "it took $duration millisecs";
> > ?>
>
> (Small correction)
> Alexander is right, but the samplecode is producing SECONDS, not millis.
>
> time - Return current Unix timestamp
> Description
> int time ( void )
> Returns the current time measured in the number of seconds since the
> Unix Epoch (January 1 1970 00:00:00 GMT).
>
> If you want millis, use microtime:
>
> microtime - Return current Unix timestamp with microseconds
>
> Regards,
> Erwin Moller- Hide quoted text -
Thanks to both of you. I use the trick as suggested here, I was just
wondering whether there is another solution.
Have a nice weekend
Sonnich
Re: Time for page
am 31.08.2007 14:31:01 von Erwin Moller
Sonnich Jensen wrote:
> On Aug 31, 12:07 pm, Erwin Moller
> wrote:
>> alexan...@modelagentur.de wrote:
>>> On 31 Aug., 09:04, Sonnich Jensen
>>> wrote:
>>>> Hi!
>>>> Is there a timer for the page, so I can see how long it has taken for
>>>> process the page?
>>>> Say, the page opens,and at the buttom there is a text say "it took 4
>>>> hrs to process your request" :-)
>>>> BR
>>>> Sonnich
>>> begin of page
>>>
>>> $t1=time();
>>> ...end of page...
>>> $t2=time();
>>> $duration=$t2-t1;
>>> echo "it took $duration millisecs";
>>> ?>
>> (Small correction)
>> Alexander is right, but the samplecode is producing SECONDS, not millis.
>>
>> time - Return current Unix timestamp
>> Description
>> int time ( void )
>> Returns the current time measured in the number of seconds since the
>> Unix Epoch (January 1 1970 00:00:00 GMT).
>>
>> If you want millis, use microtime:
>>
>> microtime - Return current Unix timestamp with microseconds
>>
>> Regards,
>> Erwin Moller- Hide quoted text -
>
> Thanks to both of you. I use the trick as suggested here, I was just
> wondering whether there is another solution.
Hi Sonnich,
Yes, there are other solutions.
Like a profiler/debugger solution.
I think it is build in in Zend Framework/Platform.
If you need this kind of information on a regular basis, you might have
a look at it. (Free trial at www.zend.com)
But be prepared: You'll have to install it, open ports on the server for
debugging/profiling, etc.
It is not just some program that automagically produces this information.
But maybe it is easy, I never used it actually. ;-)
(I use Basic Zend Development Environment, the simple version)
Regards,
Erwin Moller
>
> Have a nice weekend
> Sonnich
>