www.pudn.com > ADO 2.6 Programmers Reference(Source Code).zip > CTimer.cls


VERSION 1.0 CLASS 
BEGIN 
  MultiUse = -1  'True 
END 
Attribute VB_Name = "CTimer" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = True 
Attribute VB_PredeclaredId = False 
Attribute VB_Exposed = False 
' Simple high resolution timer class 
' 
' Methods: 
'   StartTiming                 reset timer and start timing 
'   StopTiming                  stop timer 
' 
'Properties 
'   TotalTime                   Time in milliseconds 
 
'Windows API function declarations 
Private Declare Function timeGetTime Lib "winmm" () As Long 
 
'Local variable declarations 
Private lngStartTime As Long 
Private lngTotalTime As Long 
Private lngCurTime As Long 
 
Public Property Get TotalTime() As String 
 
    TotalTime = lngTotalTime 
 
End Property 
 
Public Sub StartTiming() 
 
    lngTotalTime = 0 
 
    lngStartTime = timeGetTime() 
 
End Sub 
 
Public Sub StopTiming() 
 
    lngCurTime = timeGetTime() 
 
    lngTotalTime = (lngCurTime - lngStartTime) 
 
End Sub