Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim StartTicks As Currency
Dim StopTicks As Currency
Dim Frequency As Currency
Dim i As Long
Dim a As Long
Dim b As String
a = 2504
QueryPerformanceFrequency Frequency
QueryPerformanceCounter StartTicks
For i= 1 To 1000000
b = Format$(((a / 100) - (Int(a / 100))) * 100, "00")
'b = Right$(a, 2)
Next i
QueryPerformanceCounter StopTicks
MsgBox (StopTicks - StartTicks) / Frequency
[blue]Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Private Sub mysub()
' QP supporting declares
Dim myFreq As Currency
Dim myStart As Currency
Dim myStop As Currency
Dim TotalTime As Double
' Main declares
Dim x As Long
Dim maxloop As Long
Dim lp As Long
Dim result As String
Dim BaseTime As Long
Dim strMsg As String
maxloop = Text1.Text
QueryPerformanceFrequency myFreq
x = 2048 'random data sample
' Base time
QueryPerformanceCounter myStart
For lp = 1 To maxloop
result = ""
Next
QueryPerformanceCounter myStop
BaseTime = CDbl((myStop - myStart) / myFreq)
' OK - now all the things we really want to time
QueryPerformanceCounter myStart
For lp = 1 To maxloop
result = Right(x, 2)
Next
QueryPerformanceCounter myStop
strMsg = "Right: " & CDbl((myStop - myStart) / myFreq) - BaseTime
QueryPerformanceCounter myStart
For lp = 1 To maxloop
result = Right$(x, 2)
Next
QueryPerformanceCounter myStop
strMsg = strMsg + vbCrLf + "Right$: " & CDbl((myStop - myStart) / myFreq) - BaseTime
QueryPerformanceCounter myStart
For lp = 1 To maxloop
result = Format$(((x / 100) - (Int(x / 100))) * 100, "00")
Next
QueryPerformanceCounter myStop
strMsg = strMsg + vbCrLf + "Format INT version: " & CDbl((myStop - myStart) / myFreq) - BaseTime
QueryPerformanceCounter myStart
For lp = 1 To maxloop
result = Format$(x Mod 100, "00")
Next
QueryPerformanceCounter myStop
strMsg = strMsg + vbCrLf + "Format MOD version: " & CDbl((myStop - myStart) / myFreq) - BaseTime
MsgBox strMsg
End Sub[/blue]