Private Declare Function ShiftRight& Lib "Z:\VbExtra.dll" (ByVal Value&, ByVal Bits&)
Sub Main()
Dim i&
Dim t#
t = Timer
For i = 1 To 10000000
'ShiftRight i, 3
Foo
Next
Debug.Print Timer - t
End
End Sub
Sub Foo()
End Sub
其中ShiftRight是对数字做右移操作:
proc ShiftRight value, bits
mov eax, [value]
mov ecx, [bits]
shr eax, cl
ret
Sub Main()
Dim i&
Dim t#
t = Timer
For i = 1 To 10000000
'ShiftRight i, 3
Foo
Next
Debug.Print Timer - t
End
End Sub
Sub Foo()
End Sub
其中ShiftRight是对数字做右移操作:
proc ShiftRight value, bits
mov eax, [value]
mov ecx, [bits]
shr eax, cl
ret