$RESOURCE VAddProc AS "vector.bin"
DECLARE FUNCTION GetTickCount LIB "kernel32" ALIAS "GetTickCount" AS LONG
DECLARE FUNCTION CallBinProc LIB "user32" ALIAS "CallWindowProcA" _
(Proc AS LONG, A1 AS LONG, A2 AS LONG, A3 AS LONG, A4 AS LONG) AS LONG
DIM VAdd AS QMEMORYSTREAM
VAdd.ExtractRes(RESOURCE(VAddProc))
DEFINT i, Tmr, Vectors(1 TO 30000), Result(1 TO 3)
RANDOMIZE 666
FOR i = 1 TO 30000
Vectors(i) = RND * 10
NEXT i
Tmr = GetTickCount
CallBinProc VAdd.Pointer, 10000, VARPTR(Vectors(1)), VARPTR(Result(1)), 0
Tmr = GetTickCount - Tmr
PRINT "The result is {", Result(1), ", ", Result(2), ", ", Result(3), "}"
PRINT "Elapsed time: ", Tmr, " ms"
|