Hello, This method is good, however there is one bug in it. The time retrieved by GetPerformanceCounter is in MICROseconds (not in milliseconds).
http://www.amibroker.com/f?getperformancecounter 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 ----- From: Herman To: AmiBroker Users Group 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
