Here's The code....
Code:
#COMPILE EXE #DIM ALL #BREAK ON SUB FastPrint(Str AS STRING) PAGE 2,1 PRINT Str; PCOPY 2,1 PAGE 1,1 END SUB SUB FastPrintLn(Str AS STRING) PAGE 2,1 PRINT Str PCOPY 2,1 PAGE 1,1 END SUB FUNCTION PBMAIN () AS LONG DIM Ar(5000000) AS DWORD DIM t AS DWORD DIM X AS DWORD DIM y AS DWORD DIM avg AS DWORD DIM Total AS DWORD DIM Mx AS DWORD DIM First AS INTEGER DIM Ticker AS QUAD RANDOMIZE -TIMER COLOR 15 CALL FastPrintLn(REPEAT$(8,"<)-=[]=-(>")) First = TIMER TIX Ticker Mx = UBOUND(Ar()) FOR T = 0 TO Mx Ar(T) = RND(1,Mx) NEXT COLOR 11 CALL FastPrintLn("Array Created and Populated with " + USING$("###,###,###,###",Mx + 1) + " Elements.") COLOR 12 CALL FastPrint("Sorting....") ARRAY SORT Ar() COLOR 10 CALL FastPrintLn("Done!") COLOR 7 CALL FastPrint("Averaging Data...") Total = 0 FOR T = 0 TO Mx Total = Total + Ar(T) NEXT T Avg = Total / Mx COLOR 9 CALL FastPrintLn("Done!") CALL FastPrintLn("") CALL FastPrintLn("") COLOR 15 PAGE 1,1 PRINT PRINT CALL FastPrintLn(REPEAT$(10,"<)-[]-(>")) PRINT COLOR 11 CALL FastPrintLn("Average = " + Upbfo$("###,###,###,###",Avg)) CALL FastPrintLn("Total = " + USING$("###,###,###,###",Total)) CALL FastPrintLn("Minimum = " + USING$("###,###,###,###",Ar(0))) CALL FastPrintLn("Maximum = " + USING$("###,###,###,###",Ar(Mx))) CALL FastPrintLn("Time = " + USING$("###,###,###,###",(TIMER - First)) + " Second(s).") TIX END Ticker CALL FastPrintLn("Ticks = " + USING$("###,###,###,###",Ticker)) COLOR 10 CALL FastPrintLn("Press Any Key To Continue...") PROFILE "JohnProfile.txt" WAITKEY$ END FUNCTION