Youeee
Youeee

Reputation: 393

VB6 Application timing

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 ?

Upvotes: 4

Views: 1355

Answers (3)

xpda
xpda

Reputation: 15813

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

Upvotes: 0

MarkJ
MarkJ

Reputation: 30408

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.

Upvotes: 5

AnthonyWJones
AnthonyWJones

Reputation: 189505

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

Upvotes: 2

Related Questions