wrote some code..

<?
function test($testid) {
 echo "called from $testid!<br>";
 return 4;
}


echo "DOING THE FIRST TEST<BR>";
for ($i = 0; $i < test('first'); $i++) {
 //doStuff
};
echo "<br>";
echo "DOING THE SECOND EMILE COMPACT BLAH TEST<BR>";
for ($i = 0; $i < ($num?$num:($num = test('second')));  $i++) {
 //doStuff
};

//for ($i = 0; $i < ($num?$num:($num = mysql_num_rows($Results))); $i++) {

//};
?>

tralalal good luck


"David Robley" <[EMAIL PROTECTED]> schreef in bericht
01091910452903.15278@www">news:01091910452903.15278@www...
> 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?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to