* Thus wrote Ray ([EMAIL PROTECTED]):
> 
> so if $a is something like the size of an array or another thing that affects 
> the number of times the loop needs to be run. then if you can, reverse the 
> order of the loop so you can compare to 0 (or another constant)
> 
> <?php
> $a = 10000000;
> $i = $a;
> while( $i-- > 0 ){}
> ?>
> real  0m7.111s
> user  0m6.870s
> sys   0m0.040s

Interesting approach...  yet:

My results for above
31.017u 0.007s 0:31.14 99.5%    1544+918k 0+0io 0pf+0w

You can optimize it some more:
<?php
 $a = 10000000;
 $i = $a;
 while( $i-- ){}
?>
these results
19.008u 0.031s 0:19.58 97.1%    1544+918k 0+0io 0pf+0w


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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

Reply via email to