VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

CPerformance

Ricardo Saat  (1 Submission)   Debugging and Error Handling   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

This class encapsulate QueryPerfomanceXXX
API functions to mesure small time intervals. You can use this class
to mesure how much time your code take. This function can mesure time
intervals near 0.1 ms , 10 times better then timeGetTime() API or
GetTickCount() that have an error of 50ms.
Example:
Dim m_performance As CPerformance
Dim i As integer
Set m_performance = new CPerformance
m_performance.StartCounter()
'Do something
For i = 1 to 1000
next i
m_performance.StopCounter()
Debug.print m_performance.TimeElapsed() 'Time in ms (1/1000) s
'this is a float number
'ex: 1.54 ms

Inputs
None

Returns
Time interval in ms.

Side Effects
The API function maybe not work, but it's very rare.

API Declarations


Rate CPerformance (5(5 Vote))
CPerformance.bas

CPerformance Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters