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 uses
Classes, SysUtils, Forms, Controls, StdCtrls, Buttons, ButtonPanel, EditBtn, Classes, SysUtils, Forms, Controls, StdCtrls, Buttons, ButtonPanel, EditBtn,
contnrs, LCLProc, Compiler, LazarusIDEStrConsts; Dialogs, contnrs, LCLProc, Compiler, LazarusIDEStrConsts;
type type
@ -115,8 +115,17 @@ begin
end; end;
procedure TfrmAllCompilerOptions.OnIdle(Sender: TObject; var Done: Boolean); procedure TfrmAllCompilerOptions.OnIdle(Sender: TObject; var Done: Boolean);
{$IFDEF TimeAllCompilerOptions}
var
StartTime, EndTime: TDateTime;
fs: TFormatSettings;
ms: string;
{$ENDIF}
begin begin
IdleConnected := False; IdleConnected := False;
{$IFDEF TimeAllCompilerOptions}
StartTime := Now;
{$ENDIF}
Screen.Cursor := crHourGlass; Screen.Cursor := crHourGlass;
try try
edOptionsFilter.Enabled := False; edOptionsFilter.Enabled := False;
@ -125,6 +134,16 @@ begin
finally finally
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; 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; end;
procedure TfrmAllCompilerOptions.CheckBoxClick(Sender: TObject); procedure TfrmAllCompilerOptions.CheckBoxClick(Sender: TObject);
@ -292,7 +311,6 @@ begin
if not FInitialRender then if not FInitialRender then
FocusControl(edOptionsFilter); FocusControl(edOptionsFilter);
{$ENDIF} {$ENDIF}
FInitialRender := False;
finally finally
Container.EnableAutoSizing; Container.EnableAutoSizing;
Container.Invalidate; Container.Invalidate;

View File

@ -624,6 +624,11 @@ end;
procedure TCompilerOtherOptionsFrame.OnIdle(Sender: TObject; var Done: Boolean); procedure TCompilerOtherOptionsFrame.OnIdle(Sender: TObject; var Done: Boolean);
var var
OldIdleConnected: TIdleActions; OldIdleConnected: TIdleActions;
{$IFDEF TimeAllCompilerOptions}
StartTime, EndTime: TDateTime;
fs: TFormatSettings;
ms: String;
{$ENDIF}
begin begin
OldIdleConnected := IdleConnected; OldIdleConnected := IdleConnected;
IdleConnected := []; IdleConnected := [];
@ -634,6 +639,9 @@ begin
if (iaCompilerOpts in OldIdleConnected) if (iaCompilerOpts in OldIdleConnected)
and (FOptionsReader.RootOptGroup.CompilerOpts.Count = 0) then and (FOptionsReader.RootOptGroup.CompilerOpts.Count = 0) then
begin begin
{$IFDEF TimeAllCompilerOptions}
StartTime := Now;
{$ENDIF}
Screen.Cursor := crHourGlass; Screen.Cursor := crHourGlass;
try try
try try
@ -647,6 +655,13 @@ begin
finally finally
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; 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;
end; end;