How to get the run time of the app

zhaozj2021-02-16  47

You can get it using the function gettickcount, but he is an API, œ, to declare it. It is also necessary to note that this function returns milliseconds, so you need to convert your unit yourself! GetTickCount gets the operating time of the operating system until now, then the return value is reduced twice.

Option ExplicitPrivate Declare Function GettickCount Lib "kernel32" () AS Longdim A As Long

PRIVATE SUB Command1_Click () MSGBOX (GettickCount - A) 'Application Running End Sub

PRIVATE SUB FORM_LOAD () a = getTickCountend Sub

Since the value returned by getTickCount is the DWORD type. Therefore, the operating system runs again after 49.7 days, this value will be attributed 0.

转载请注明原文地址:https://www.9cbs.com/read-27502.html

New Post(0)