Hello,
This method is good, however there is one bug in
it.
The time retrieved by GetPerformanceCounter is in
MICROseconds (not in milliseconds).
MICROsecond is 1/1000 part of millisecond and the
timings retrieved using the formula provided
are actually 1000 smaller. So
Param() call takes 1 MICROsecond (1 millionth part of the second).
So either you need to DIVIDE by 1000 to get
milliseconds:
function Trace( Comment ) { global LineNumber, TitleStr; PC =
GetPerformanceCounter( True )/1000; Str = "# LN: "+NumToStr(LineNumber++,1.0,False)+", PC:
"+NumToStr(PC,9.3)+" mSec., "+Comment; TitleStr = TitleStr
+ Str+"\n";
_TRACE(Str); }
Or write MICRO seconds instead:
function Trace( Comment ) { global LineNumber, TitleStr; PC =
GetPerformanceCounter( True ); Str = "#
LN: "+NumToStr(LineNumber++,1.0,False)+", PC:
"+NumToStr(PC,9.3)+" uSec. (microsecond), "+Comment;
TitleStr = TitleStr + Str+"\n";
_TRACE(Str); }
Best regards, Tomasz
Janeczko amibroker.com
----- Original Message -----
Sent: Sunday, September 23, 2007 6:02
PM
Subject: [amibroker] Measuring AFL
Execution Times
http://www.amibroker.org/userkb/2007/09/23/measuring-afl-execution-times/
Best regards,
herman
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
__,_._,___
|