VB6 Application timing

2019-02-24 14:49发布

问题:

I am attempting to profile a VB6 application.

Basically I wanted to work out at a method by method level how much time execution is taking.

However VB6 only supports times to 1 sec. Is there any good way of working out millisecs etc ?

回答1:

Although MSDN says Timer is only accurate to 1 second, I've found it's better than that in practise.

GetTickCount is typically accurate to about 10 to 16 milliseconds. Here's a VB6 declaration.

 Declare Function GetTickCount Lib "Kernel32" () As Long

The same Microsoft article shows how to use QueryPerformanceCounter to get much higher accuracy, if your PC supports it, and if you need it.



回答2:

Use the High-Performance Timer Objects from the CCRP project instead



回答3:

If I remember right, TimeGetTime is pretty accurate, from winmm.dll.

https://msdn.microsoft.com/en-us/library/windows/desktop/dd757629%28v=vs.85%29.aspx



标签: time vb6