Re: Speeding up program
| From: | David Robley | Date: | Wed, 19 Sep 2001 01:15:29 +0000 |
| Subject: | Re: Speeding up program | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67773@lists.php.net to get a copy of this message | ||
On Tue, 18 Sep 2001 20:56, Niklas Lampén wrote:
> How big difference does it make in speed in these:
>
> <?
> for ($i = 0; $i < mysql_num_rows($Results); $i++) {
> blah
> };
> ?>
>
> or
>
> <?
> $n = mysql_num_rows($Results);
> for ($i = 0; $i < $n; $i++) {
> blah
> };
> ?>
>
> So actually I'm asking how much more/less it takes time to do the
> comparing against mysql_num_rows() insted of comparing against a
> variable.
>
>
> Niklas
Will deppend on the environment in which you are running it. to test it
on your environment, try running each say ten thousand times in a loop,
and use a timer like microtime to check how long it takes.\
Then you can let us all know the answer.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Why can't we just spell it orderves?