You are here: Re: [PHP] gethostbyname() time issues « PHP « IT news, forums, messages
Re: [PHP] gethostbyname() time issues

Posted by "Kristen G. Thorson" on 11/14/68 11:22

Philip Hallstrom wrote:

>> $diff = number_format(((substr($timeend,0,9)) +
>> (substr($timeend,-10)) - (substr($timestart,0,9)) -
>> (substr($timestart,-10))),4);
>
>
> This just looks wrong to me... at the very least shouldn't it be:
>
> (x + x) - (x + x)


(x + y) - (w + z) = (x + y) + (-w - z) = x + y - w - z

Which is what I have. If you look closely, I don't have (x + x) - (x -
x), which yes, would be wrong.


>
> You've currently got the last + as a -.
>
> Also, why not split the result of microtime on a space in case $usec
> is more than 9 digits....?
>

$usec is microseconds. I'm not really concerned about more than
ten-thousandths of a second, so I don't even really need 9 digits.
Conversly, I only need the seconds digits that are changing, and I can
guarantee (hopefully) that my script is not taking so long that I need
more than 10 digits to calculate the difference in seconds.

It may be ridiculously convoluted code, I'll grant you that ;) - I took
it from old script somewhere and didn't think of the looking in the
manual for the much simpler example - but I'm pretty sure the math is fine.

Anyways, I can assure you that it is too fast for me to count 1, 2, 3
CLI, but I get up to 20-something waiting for it to run under apache.
Any ideas?



kgt

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация