Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timing processes to speed up code

Status
Not open for further replies.

themaj

Technical User
Apr 10, 2006
37
0
0
US
I am trying to evaluate methods of speeding up certain precedures and processes in a database program and wondered whether anyone might be able to tell me how to time certain events for analysis in milliseconds.
Example: Click a cmd_button and that starts the 'stopwatch' with a msgbox or ???? displaying the elapsed time when the process is finished.

Any help greatly appreciate.
 
Have you considered 3rd party tools like VB Watch Profiler and others? I believe there are several still on the market for VB 6.0 programming.

These do a good job within the limitations inherent in such tools. Most have a free demo version too. I think VB Watch demo is good for projects with up to 10 source files or something like that. It automates the heck out of instrumentation tasks like those you're decribing, pretty much down to the source statement level. I had discounted such things and relied on my own timing code until trying it out.

I thought there was a small profiler that came with VS 6.0 too but I lost track of it. Maybe it was sample code or something.
 
You can use high-resolution performance counter API functions to time your code.

Do a keyword search in this forum for QueryPerformanceCounter and you will find a number of solutions closely related to your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top