Re: time() TIMER in seconds or just numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 30, 2009 at 1:51 PM, Igor Escobar <titiolinkin@xxxxxxxxx> wrote:
> Okey, but you understand the purpouse of it?
>
> On Mon, Mar 30, 2009 at 3:42 PM, haliphax <haliphax@xxxxxxxxx> wrote:
>>
>> On Mon, Mar 30, 2009 at 11:37 AM, Igor Escobar <titiolinkin@xxxxxxxxx>
>> wrote:
>> > The people use that to measure performance.
>> >
>> > If you're intersted about that read
>> >
>> > http://www.igorescobar.com/blog/2009/03/05/benchmarking-de-desempenho-no-php/
>> > (in portuguese, sorry)
>> >
>> > Regards,
>> > Igor Escobar
>> >
>> > On Mon, Mar 30, 2009 at 1:05 PM, haliphax <haliphax@xxxxxxxxx> wrote:
>> >>
>> >> On Mon, Mar 30, 2009 at 10:47 AM, Richard Heyes <richard@xxxxxxx>
>> >> wrote:
>> >> >> When someone does that, it means the execution time between $t1 and
>> >> >> $t2...
>> >> >
>> >> > Is that for my benefit? Believe it or not, I do know the arcane art
>> >> > of
>> >> > subtraction...
>> >>
>> >> I would subtract more often, but sacrificial farm animals and black
>> >> candles are so hard to come by these days...
>>
>> Oh, I'm fully aware of what it's for. FYI, microtime() is probably
>> more appropriate, since 1 full second in computer terms is a loooooong
>> time.
>>
>> ...and I don't speak a lick of Portuguese.

Please stop top-posting.

"I'm fully aware of what it's for" == "I am aware of its purpose".

My point was that time() gives you seconds since the UNIX epoch,
whereas microtime(true) will give you more accurate results if you are
looking to benchmark a script. If your script takes a few minutes and
you don't really care about measuring those milli/micro seconds, then
time() should suit your needs just fine. However, if your script can
perform an iteration in less than one second, you have already
eliminated the usefulness of time() for benchmarks.


-- 
// Todd

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux