fb:porticula NoPaste
byref langsamer als byval?
Uploader: | frebas |
Datum/Zeit: | 15.03.2010 21:43:22 |
Dim As UInteger a
Declare Sub sByVal(ByVal b As UInteger)
Declare Sub sByref(ByRef b As UInteger)
Dim As Double tmr
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Print " "
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
Print " "
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByVal(tempui)
Next
Print "byval: "+STR(Timer-tmr)
Print " "
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
For tempui As UInteger = 1 To 100000000
sByRef(tempui)
Next
Print "byref: "+Str(Timer-tmr)
Sleep 150,1
tmr=Timer
SLEEP
Sub sByVal(ByVal b As UInteger)
Dim c As UInteger
c=b+c
End Sub
Sub sByRef(Byref b As UInteger)
Dim c As UInteger
c=b+c
End Sub