急急!!VB程序问题,,。。。

来源:百度知道 编辑:UC知道 时间:2024/07/04 11:19:29
请问各位大虾,用VB怎么计数系统运行时间。。谢谢,,

Private Declare Function GetTickCount& Lib "kernel32" ()

Dim a As Long
Dim b As Long
Dim c As Long
Dim d As Long
Dim e As Long

Private Sub Form_Load()
a = GetTickCount \ 1000
b = GetTickCount \ 1000 \ 60
c = GetTickCount \ 1000 \ 60 \ 60
d = (a - c * 3600) \ 60
e = a - b * 60
lblsecond.Caption = e & "秒"
lblminute.Caption = d & "分"
lblhour.Caption = c & "小时"
End Sub