Say you wanted to make a little timer on your app that says how long you have been on the perticular program. How would you do that?
Printable View
Say you wanted to make a little timer on your app that says how long you have been on the perticular program. How would you do that?
Code:Option Explicit
Private Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
Private t1 As Long
Private t2 As Long
Private Sub Form_Load()
t1 = GetTickCount
End sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
t2 = GetTickCount
MsgBox "This Program have been running for " & t2 - t1 & " miliseconds."
End Sub