Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "crt.bi"
- #macro SetArray( _Arr , _Vals... )
- scope
- dim as typeof(_Arr(0)) ArrTemp(lbound(_Arr) to ubound(_Arr)) = _Vals
- memcpy( @_Arr(lbound(_Arr)) , @ArrTemp(lbound(ArrTemp)) , ((ubound(_Arr)-lbound(_Arr))+1)*sizeof(_Arr(0)) )
- end scope
- #endmacro
- #macro SetArrayConst( _Cnt , _Arr , _Vals... )
- scope
- static as typeof(_Arr(0)) ArrTemp((_Cnt)-1) = _Vals
- memcpy( @_Arr(lbound(_Arr)) , @ArrTemp(0) , (_Cnt)*sizeof(_Arr(0)) )
- end scope
- #endmacro
- dim as integer NN(7)
- dim as double TMR
- TMR = timer
- for N as integer = 0 to 2^20
- SetArray( NN , { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 } )
- next N
- print (timer-TMR)*1000;"ms - SetArray()", NN(6)
- TMR = timer
- for N as integer = 0 to 2^20
- SetArrayConst( 8 , NN , { 00 , 11 , 22 , 33 , 44 , 55 , 66 , 77 } )
- next N
- print (timer-TMR)*1000;"ms - SetArrayConst()", NN(6)
- TMR = timer
- for N as integer = 0 to 2^20
- NN(0)=0:NN(1)=111:NN(2)=222:NN(3)=333:NN(4)=444:NN(5)=555:NN(6)=666:NN(7)=777
- next N
- print (timer-TMR)*1000;"ms - 'Manual Set'", NN(6)
- sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement