46 lines
1.3 KiB
VB.net
Raw Permalink Normal View History

Module TimeKernalModule
Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Integer
Public Const MeasStart As Boolean = True
Public Const MeasEnd As Boolean = False
Public Function MeasureTime(StartEnd As Boolean) As Long
Static Dim nStartTick As Long
Static Dim nEndTick As Long
If StartEnd = MeasStart Then
nStartTick = GetTickCount()
Return 0
Else
nEndTick = GetTickCount()
Return (nEndTick - nStartTick)
End If
End Function
Public Function MeasureTimeFunc(StartEnd As Boolean) As Long
Static Dim nStartTick As Long
Static Dim nEndTick As Long
If StartEnd = MeasStart Then
nStartTick = GetTickCount()
Return 0
Else
nEndTick = GetTickCount()
Return (nEndTick - nStartTick)
End If
End Function
Public Function MeasureTimeAll(StartEnd As Boolean) As Long
Static Dim nStartTick As Long
Static Dim nEndTick As Long
If StartEnd = MeasStart Then
nStartTick = GetTickCount()
Return 0
Else
nEndTick = GetTickCount()
Return (nEndTick - nStartTick)
End If
End Function
End Module