Article ID: 174808
Article Last Modified on 5/13/2003
Option Explicit
Private Sub Form_Load()
Dim lngCounter As Long, x As Long, y As Long, tmp As Long
Dim tmrStart As Double
Dim strMsg As String
tmrStart = Timer
For lngCounter = 1 To 1000000
x = 100
y = 500
tmp = x
x = y
y = tmp
Next lngCounter
strMsg = "Inline took " & Str(Timer - tmrStart) & " seconds."
MsgBox (strMsg)
End
End Sub
Sub Form_Load()
Swap
End Sub
Option Explicit
Dim x As Long, y As Long, tmp As Long
Public Sub Swap()
Dim lngCounter As Long
Dim tmrStart As Double
Dim strMsg As String
tmrStart = Timer
For lngCounter = 1 To 1000000
x = 100
y = 500
tmp = x
x = y
y = tmp
Next lngCounter
strMsg = "Function Call took " & Str(Timer - tmrStart)
strMsg = strMsg & " seconds."
MsgBox (strMsg)
End
End Sub
Option Explicit
Private Sub Form_Load()
Dim lngCounter As Long, x As Long, y As Long, tmp As Long
Dim tmrStart As Double
Dim strMsg As String
tmrStart = Timer
x = 100
y = 500
For lngCounter = 1 To 1000000
GoSub Swap
Next lngCounter
strMsg = "GoSub took " & Str(Timer - tmrStart) & " seconds."
MsgBox (strMsg)
End
Swap:
tmp = x
x = y
y = tmp
Return
End Sub
Option Explicit
Private Sub Form_Load()
Command1.Caption = "Inline"
Command2.Caption = "Go Sub"
Command3.Caption = "Function Call"
End Sub
Private Sub Command1_Click()
Shell ("<path>inline.exe")'<<< Change <path> to the path of
' inline.exe
End Sub
Private Sub Command2_Click()
Shell ("<path>Gosub.exe") '<<< Change <path> to the path
' of GoSub.exe
End Sub
Private Sub Command3_Click()
Shell ("<path>FunctionCall.exe") '<<< Change <path> to the path
' of FunctionCall.exe
End Sub
Keywords: kbprb kbcompiler KB174808