IDE: allow timing of reading and rendering all compiler options.

git-svn-id: trunk@42432 -
This commit is contained in:
juha 2013-08-20 11:44:37 +00:00
parent 9f79ea9d97
commit de6c937cf4
2 changed files with 35 additions and 2 deletions

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, Forms, Controls, StdCtrls, Buttons, ButtonPanel, EditBtn,
contnrs, LCLProc, Compiler, LazarusIDEStrConsts;
Dialogs, contnrs, LCLProc, Compiler, LazarusIDEStrConsts;
type
@ -115,8 +115,17 @@ begin
end;
procedure TfrmAllCompilerOptions.OnIdle(Sender: TObject; var Done: Boolean);
{$IFDEF TimeAllCompilerOptions}
var
StartTime, EndTime: TDateTime;
fs: TFormatSettings;
ms: string;
{$ENDIF}
begin
IdleConnected := False;
{$IFDEF TimeAllCompilerOptions}
StartTime := Now;
{$ENDIF}
Screen.Cursor := crHourGlass;
try
edOptionsFilter.Enabled := False;
@ -125,6 +134,16 @@ begin
finally
Screen.Cursor := crDefault;
end;
{$IFDEF TimeAllCompilerOptions}
if FInitialRender then begin
EndTime := Now-StartTime;
ms := FormatDateTime('zzz', EndTime);
fs.TimeSeparator := ':';
ShowMessage(Format('Rendering compiler options GUI took: %s.%s',
[FormatDateTime('nn:ss', EndTime, fs), ms]));
end;
{$ENDIF}
FInitialRender := False;
end;
procedure TfrmAllCompilerOptions.CheckBoxClick(Sender: TObject);
@ -292,7 +311,6 @@ begin
if not FInitialRender then
FocusControl(edOptionsFilter);
{$ENDIF}
FInitialRender := False;
finally
Container.EnableAutoSizing;
Container.Invalidate;

View File

@ -624,6 +624,11 @@ end;
procedure TCompilerOtherOptionsFrame.OnIdle(Sender: TObject; var Done: Boolean);
var
OldIdleConnected: TIdleActions;
{$IFDEF TimeAllCompilerOptions}
StartTime, EndTime: TDateTime;
fs: TFormatSettings;
ms: String;
{$ENDIF}
begin
OldIdleConnected := IdleConnected;
IdleConnected := [];
@ -634,6 +639,9 @@ begin
if (iaCompilerOpts in OldIdleConnected)
and (FOptionsReader.RootOptGroup.CompilerOpts.Count = 0) then
begin
{$IFDEF TimeAllCompilerOptions}
StartTime := Now;
{$ENDIF}
Screen.Cursor := crHourGlass;
try
try
@ -647,6 +655,13 @@ begin
finally
Screen.Cursor := crDefault;
end;
{$IFDEF TimeAllCompilerOptions}
EndTime := Now-StartTime;
ms := FormatDateTime('zzz', EndTime);
fs.TimeSeparator := ':';
ShowMessage(Format('Reading compiler options took: %s.%s',
[FormatDateTime('nn:ss', EndTime, fs), ms]));
{$ENDIF}
end;
end;