fpspreadsheet: Add measurement of file loading time to fpsctrls/demo_ctrl

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4028 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2015-03-14 22:10:29 +00:00
parent 6a263081e6
commit b406d1e64d
3 changed files with 14 additions and 2 deletions

View File

@ -76,13 +76,18 @@
<Unit2>
<Filename Value="..\shared\scsvparamsform.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="CSVParamsForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="sCSVParamsForm"/>
</Unit2>
<Unit3>
<Filename Value="..\shared\sformatsettingsform.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="FormatSettingsForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="sFormatsettingsForm"/>
</Unit3>
<Unit4>
<Filename Value="..\shared\ssortparamsform.pas"/>
@ -93,6 +98,7 @@
<Filename Value="..\shared\scurrencyform.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="CurrencyForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="scurrencyform"/>
</Unit5>

View File

@ -7,8 +7,8 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, main, scsvparamsform, sformatsettingsform,
ssortparamsform, scurrencyform
Forms, main,
scsvparamsform, sformatsettingsform, ssortparamsform, scurrencyform
{ you can add units after this };
{$R *.res}

View File

@ -320,6 +320,7 @@ implementation
{$R *.lfm}
uses
LCLProc, // debugln
fpsUtils, fpsCSV,
sCSVParamsForm, sCurrencyForm, sFormatSettingsForm, sSortParamsForm;
@ -328,6 +329,8 @@ uses
{ Loads the spreadsheet file selected by the AcFileOpen action }
procedure TMainForm.AcFileOpenAccept(Sender: TObject);
var
t: TTime;
begin
WorkbookSource.AutodetectFormat := false;
case AcFileOpen.Dialog.FilterIndex of
@ -340,7 +343,10 @@ begin
7: WorkbookSource.FileFormat := sfOpenDocument; // Open/LibreOffice
8: WorkbookSource.FileFormat := sfCSV; // Text files
end;
t := now;
WorkbookSource.FileName := UTF8ToAnsi(AcFileOpen.Dialog.FileName); // this loads the file
t := (now - t)*24*3600;
DebugLn(Format('Loading time for %s: %.3f sec', [AcFileOpen.Dialog.FileName, t]));
UpdateCaption;
end;