home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch15 / ctimer / ctimer.cls next >
Encoding:
Visual Basic class definition  |  1998-06-22  |  705 b   |  33 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "CTimer"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Dim totalInterval As Double
  15. Dim T1 As Double
  16.  
  17. Public Sub StartCounting()
  18.     T1 = Time
  19. End Sub
  20.  
  21. Public Sub StopCounting()
  22.     totalInterval = totalInterval + Time - T1
  23. End Sub
  24.  
  25. Property Get ElapsedTime() As Double
  26.     ElapsedTime = totalInterval
  27. End Property
  28.  
  29. Public Sub ResetTimer()
  30.     totalInterval = 0
  31. End Sub
  32.  
  33.