nSec = SECONDS() nT = 1 DO WHILE nT < 1000000 nT = nT + 1 ENDDO WAIT WINDOW SECONDS() - nSec nSec = SECONDS() FOR nT = 1 TO 1000000 ENDFOR WAIT WINDOW SECONDS() - nSecIn this case there is no doubt your observation makes sence. I've got a result of 1.031 for DO WHILE and 0,088 for FOR NEXT: A 1171% performance difference. Seems quite convincing.
nSec = SECONDS() nSum = 0 nT = 1 DO WHILE nSum < 10000000000 nT = nT + 1 nSum = nSum + nT ENDDO ? nT WAIT WINDOW SECONDS() - nSec nSec = SECONDS() nSum = 0 FOR nT = 1 TO 1000000 nSum = nSum + nT IF nSum > 10000000000 EXIT ENDIF ENDFOR ? nT WAIT WINDOW SECONDS() - nSecThis is a very simple and fast example for summing up all integers from 1 to [ n ] until they reach a certain value. If you run this example you'll notice that the difference between the two implementation is narrowed down to about 38% (in 141421 iterations), and this is body is very very simple. If it becomes more complex than this the difference very quickly becomes irrelevant.