Re: microtime questions

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

 



Tedd,

I think Brad was just making some observations, he wasn't trying to be rude.
When he said that "the time differentials are too be expected." I think he
was just answering the question of why the exact same FOR loop could
possibly take different amounts of time to execute under the same conditions
in the script; not necessarily why it was providing negative values.

On your original issue, were you able to make use of the example function on
http://php.net/microtime? The documentation there along with what I posted
should hopefully clear things up for you as to why microtime() is reliable,
and that it doesn't return a pure float that should be used in equations. It
seems as though you knew that, but as I said before the way that you're
using microtime() is not valid with the version of PHP your host is using.

Please let us know if you'd like more clarification on this. There are a lot
of people on this list, so someone will have the answer that you need. ;-)

- Joe

On 4/7/06, tedd <tedd@xxxxxxxxxxxx> wrote:
>
> -B
>
> At 12:51 PM -0400 4/7/06, Brad Bonkoski wrote:
> >How is the CPU not in question?  Does this script run on air?
>
> I did not say that. I said that it was not MY CPU that was involved
> and it isn't.
>
> >It may not be YOUR CPU, but it is still a CPU bound by the sceduling
> >algorithm of the Operating System, so the time differentials are too
> >be expected.
>
> Negative times are expected? Incorrect times are expected? What's the
> point of microtime if you can't reply on it?
>
> Please explain.
>
> tedd
>
> --- previous ---
>
> >-B
> >
> >tedd wrote:
> >
> >>At 12:24 PM -0400 4/7/06, Brad Bonkoski wrote:
> >>
> >>>Interesting...
> >>>as for your first question...
> >>>Know that PHP/Apache does not have free reign to your CPU, so the
> >>>times could be different based on the scheduling going on in the
> >>>OS kernel.
> >>>
> >>>As for the second one...
> >>>No idea why you would get a negative number, I just copied and ran
> >>>from the command line and did not encounter 1 negative time for
> >>>about 30 runs....
> >>>
> >>>Do you get negative times if you run it from the command line as well?
> >>>-B
> >>>
> >>>>RE:
> >>>>
> >>>>http://www.xn--ovg.com/microtime.php
> >>>>
> >>
> >>Brad:
> >>
> >>Thanks for looking.
> >>
> >>My questions are with regard to what happens on the site, not via
> >>my command line. As such, my command line and my CPU are not
> >>involved.
> >>
> >>Can you answer the questions as they pertain to the site in question?
> >>
> >>Thanks.
> >>
> >>tedd
>
>
> --
>
> --------------------------------------------------------------------------------
> http://sperling.com
>
> --
> 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