Optimizing tip: I have used MIN&, MAX& quite a lot in my code without
reflecting over possible slowness. Just did a test and found it's best
to skip those commands all together. Following gives same result, but
IF/THEN is much faster:
------------------
Corrected stupid error after tips from Florent, see below..
[This message has been edited by Borje Hagsten (edited April 28, 2001).]
reflecting over possible slowness. Just did a test and found it's best
to skip those commands all together. Following gives same result, but
IF/THEN is much faster:
Code:
LOCAL I AS LONG, J AS LONG, t AS SINGLE t = TIMER FOR I = 1 TO 100000000 IF I > 50000000 THEN J = I ELSE J = 50000000 END IF NEXT MSGBOX STR$(TIMER - t) '<about 3 seconds in slow 133 MHz machine t = TIMER FOR I = 1 TO 100000000 J = MAX&(50000000, I) NEXT MSGBOX STR$(TIMER - t) 'about 6 seconds in same machine
Corrected stupid error after tips from Florent, see below..

[This message has been edited by Borje Hagsten (edited April 28, 2001).]
Comment