Which is Faster?

Blitz3D Forums/Blitz3D Programming/Which is Faster?

Your right, I just tested.

I had to jack up the iterations really high to see a difference, and even then it was pretty miniscule.

*edit #1* hold that thought-- I just realized my test is way off.... re-editing after I fix it XD *edit*

*edit #2* NM, Fixed it- I was right. This test has arrays coming up faster then types, gonna give it one more go with winamp and crap all turned off *

test...
Type blah
	Field value%
End Type
b.blah=New blah
Dim value(0)

iterations=100000000
;start test

Print "array access"
t=MilliSecs()
For i=0 To iterations
	n=value(0)
Next
t=MilliSecs()-t
Print t+" ms"
Print ""

Print "type access"
t=MilliSecs()
For i=0 To iterations
	n=b\value%
Next
t=MilliSecs()-t
Print t+" ms"
Print ""

Print "Press Any Key"
WaitKey
End


*edit #3* ya arrays slightly faster than types......man my brain is on vacation :) */edit*