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.