How to use TProfiler ???

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

How to use TProfiler ???

Postby $^$ » December 7th, 2007, 6:10 pm

Hi all....
Does anyone know how to use it???
Because i don't get it how to use it...... :(

I want to calculate my execution time......


Thx
$^$
Member
Member
 
Posts: 2
Joined: December 7th, 2007, 6:01 pm

Postby Kambiz » December 7th, 2007, 8:17 pm

Suppose you want to measure execution time of a procedure named Test, and you have put a TProfiler on the form and named it Profiler.

Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
  Profiler['Test'].Start;

  Test;

  Profiler['Test'].Stop;
end;


Whenever you need, you can use AsText property of the timer to display the result on the screen.

Code: Select all
Memo1.Lines.Add(Profiler['Test'].AsText[tiAll]);


When execution of your application is finished, you can find all timing results on Events Log of Delphi. From Delphi's menu select [View -> Debug Windows -> Event Log] or press Alt+Ctrl+V.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby $^$ » December 8th, 2007, 3:31 pm

Wow.... it's a great and simple component to use it...... =D>

Btw the units in ms.... if i use another computer and run the program..... if the result same ???? or it depends on processor frequency ???

Thx

Regard,
-$^$-
$^$
Member
Member
 
Posts: 2
Joined: December 7th, 2007, 6:01 pm

Postby Kambiz » December 8th, 2007, 8:02 pm

It depends on the processor.

In other hand, because Windows is a multi-tasking OS, in the same machine you may get different results. Because of that you have to run the test several times and use the average time.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron