CLEAR ALL
n=999999
c=5
PRINT "Create an Array with "+STR$(n+1)+" items... ";
cx=XPOS(1):cy=YPOS(1)
DIM a(n)
FOR i=0 TO n
    a(i)=i
    IF i MOD 10000=0 THEN LOCATE cx,cy:PRINT TRIM$(STR$(INT(i/10000)));"%";
NEXT i
LOCATE cx,cy:PRINT "100%"
PRINT
PRINT "Search the Array "+STR$(c)+"x using FOR/NEXT"
s=TIME
FOR i=1 TO c
    FOR j=0 TO n
        IF a(j)=n THEN EXIT FOR
    NEXT j
    PRINT j
NEXT i
e=TIME
t1=e-s
PRINT "Time: "+STR$(t1)+"ms"
PRINT
PRINT "Search the Array "+STR$(c)+"x using ARRAY FIND"
s=TIME
FOR i=1 TO c
    ARRAY FIND a(),n TO j
    PRINT j
NEXT i
e=TIME
t2=e-s
PRINT "Time: "+STR$(t2)+"ms"
PRINT
PRINT "ARRAY FIND is "+USING$("###.#",t1/t2)+"x faster"
