tags:

views:

54

answers:

2

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 ?

+3  A: 

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.

MarkJ
This is what I've always used as well.
Matthew Cole
+1  A: 

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

AnthonyWJones
+1, anything by Karl Peterson must be good.
MarkJ