记录时间的API函数。
GetTickCount Windows API函数可返回 Windows 启动以来消失的毫秒数。其精度高于VB的Timer 函数。且Timer 函数会在午夜清零,而GetTickCount 函数只有当机器连续使用49.7天后才返回零。这为我们编程提供了很大的方便。例如想知道你的电脑连续工作多久了,可新建一工程,然后添加以下代码:
Private Declare Function GetTickCount Lib “kernel32" () As Long
Private Sub Form_Load()
Dim d As Date
Dim t As Integer
Form1.Show
t = GetTickCount \ 1000
d = TimeSerial(0, 0, t)
Print d
End Sub