06-21-2010, 07:15 AM
This seems a little awkward:
Is that some optimization or better than:
?
Right now I don't know which one is faster, but my gut tells me a for/next loop ought to be - it's designed to have a loop counter. Boriel recently did some optimizations on FOR/NEXT as well, shaving a few clock cycles.
I also have a weird feeling that asking it to stop when W=200 might be a long wait, since 200 doesn't divide evenly by three. (That is, if you keep adding threes, you get 195,198,201,204... - not W=200 until it's looped right around the byte count...)
Code:
do
...code...
w=w+3
loop until w=200
Is that some optimization or better than:
Code:
FOR W=0 to 200 step 3
NEXT W
Right now I don't know which one is faster, but my gut tells me a for/next loop ought to be - it's designed to have a loop counter. Boriel recently did some optimizations on FOR/NEXT as well, shaving a few clock cycles.
I also have a weird feeling that asking it to stop when W=200 might be a long wait, since 200 doesn't divide evenly by three. (That is, if you keep adding threes, you get 195,198,201,204... - not W=200 until it's looped right around the byte count...)