Buchempfehlung
MySQL kurz & gut
MySQL kurz & gut
Das preiswerte Taschen- buch stellt MySQL-rele- vante Inhalte systematisch und knapp dar, sodass es sich optimal zum Nach- schlagen beim Pro- grammieren eignet. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

byref langsamer als byval?

Uploader:Mitgliedfrebas
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