求一个VB秒表的源代码,精确至0.01秒

来源:百度知道 编辑:UC知道 时间:2024/05/11 01:17:49

精确到毫秒
代码如下
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CStopWatch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'
' Win32 API declarations.
'
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Private Declare Function timeGetDevCaps Lib "winmm.dll" (lpTimeCaps As TIMECAPS, ByVal uSize As Long) As Long
'
' API Structure definitions.
'
Private Type TIMECAPS
wPeriodMin As Long
wPeriodMax As Long
End Type
'
' Set aside storage for private member variables.