Can someone please point me in the right direction to find info on how long a program has run, I have searched with little luck on this subject, thanks.
Private Declare Function QueryPerformanceCounter Lib "kernel32" ( _
lpPerformanceCount As Currency _
) As Long
Private Declare Function QueryPerformanceFrequency Lib "kernel32" ( _
lpFrequency As Currency _
) As Long
Dim myFreq As Currency
Dim myStart As Currency
Dim myStop As Currency
Dim TotalTime As Double
Private Sub Form_Load
QueryPerformanceFrequency myFreq
QueryPerformanceCounter myStart
End Sub
Private Sub Form_Unload(Cancel As Integer)
QueryPerformanceCounter myStop
TotalTime = CDbl((myStop - myStart) / myFreq)
'save time to file
Exit Sub
good luck!
If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
you want to find out how long another program (not one you have written) has been up for?!?!
If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.