VB6 Application timing

情到浓时终转凉″ 提交于 2019-12-30 23:23:16

问题


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



来源:https://stackoverflow.com/questions/1716940/vb6-application-timing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!