On 26 déc. 05, at 21:27, johnf wrote:
Hi,
Is there a way to measure how long a routine is taking? I'd like to
see how
much time a routine is taking and see if I can improve the performance
by
changing the code.
For example:
Add a property to the window (StartTicks As Double)
sub MethodToTest()
StartTicks=Ticks
//Long, very long code here
msgbox "The method 'MethodToTest' takes actually
"+((Ticks-StartTicks)/60)+" seconds."
end sub
"Ticks" is a method which returns the number of 1/60 of seconds since
the computer started.
You keep in memory the "Ticks" value in the beginning of the method,
you do the main code, and, finally, you substract the "Ticks" of the
end of the method from the Start value. You get the delta (now-before)
as ticks. Since ticks are 1/60 of a second, a single second is 60 times
lower so you divide the returned number by 60.
It should work, I think.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>