Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapseMilliseconds As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
' Performance Counter API's
Public Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
Public Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Public Function BeginTimer(ByVal lMilliseconds As Long) As Long
Attribute BeginTimer.VB_Description = "BeginTimer creates a new timer, and returns the new timer's ID. This function returns zero on failure; no error is raised."
Public Function EndTimer(ByRef TimerID As Long) As Boolean
Attribute EndTimer.VB_Description = "EndTimer terminates the specified timer created by BeginTimer. The TimerID is passed ByRef and is reset to zero on success."
If (TimerID) Then EndTimer = KillTimer(0&, TimerID)
Attribute ProfileStart.VB_Description = "ProfileStart returns the current value of the high-resolution performance counter as a Currency data type. You pass this value to ProfileStop which subtracts it from an ending count and returns the difference."
If mCurFreq = 0 Then QueryPerformanceFrequency mCurFreq
If (mCurFreq <> 0) Then QueryPerformanceCounter ProfileStart
End Function
Public Function ProfileStop(ByVal curStart As Currency) As Currency
Attribute ProfileStop.VB_Description = "ProfileStart returns the current value of the high-resolution performance counter as a Currency data type. You pass this value to ProfileStop which subtracts it from an ending count and returns the difference."