You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
755 B
18 lines
755 B
Attribute VB_Name = "Module1"
|
|
Public Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long
|
|
Public Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Long
|
|
Public Type LARGE_INTEGER
|
|
lowpart As Long
|
|
highpart As Long
|
|
End Type
|
|
|
|
Public Function getSecondsDifference(tstStart As LARGE_INTEGER, tstEnd As LARGE_INTEGER) As Double
|
|
Dim liFreq As LARGE_INTEGER
|
|
Dim dResult As Double
|
|
Call QueryPerformanceFrequency(liFreq)
|
|
|
|
dResult = (tstEnd.highpart * 2 ^ 32 + tstEnd.lowpart) - (tstStart.highpart * 2 ^ 32 + tstStart.lowpart)
|
|
|
|
getSecondsDifference = dResult / (liFreq.highpart * 2 ^ 32 + liFreq.lowpart)
|
|
|
|
End Function
|