Dim a As Long
Private Function Formattime(GetTickCount As Long) As String '计算中取整了,所以计算出来的12
'秒和13秒显示都是12秒
Dim hour, min, sec
hour = GetTickCount / 3600000
min = hour - Int(hour)
min = 60 * min
sec = min - Int(min)
sec = 60 * sec
hour = Int(hour)
min = Int(min)
sec = Int(sec)
gettime = Format(hour, "00") & ":" & Format(min, "00") & ":" & Format(sec, "00")
Text1 = Text1 + gettime + vbCrLf
End Function
Private Sub Timer1_Timer()
a = a + 1000
Formattime (a)
End Sub