DECLARE FUNCTION GetTickCount LIB "kernel32" ALIAS "GetTickCount" AS LONG
DEFINT i, Tmr, j, Vectors(1 TO 30000), Result(1 TO 3)
RANDOMIZE 666
FOR i = 1 TO 30000
Vectors(i) = RND * 10
NEXT i
Tmr = GetTickCount
Result(1) = 0: Result(2) = 0
Result(3) = 0: j = 1
FOR i = 1 TO 10000
Result(1) = Result(1) + Vectors(j)
Result(2) = Result(2) + Vectors(j + 1)
Result(3) = Result(3) + Vectors(j + 2)
j += 3
NEXT i
Tmr = GetTickCount - Tmr
PRINT "The result is {", Result(1), ", ", Result(2), ", ", Result(3), "}"
PRINT "Elapsed time: ", Tmr, " ms"
|