You've already forked lazarus-ccr
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:
@ -76,13 +76,18 @@
|
|||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="..\shared\scsvparamsform.pas"/>
|
<Filename Value="..\shared\scsvparamsform.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="CSVParamsForm"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="sCSVParamsForm"/>
|
<UnitName Value="sCSVParamsForm"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="..\shared\sformatsettingsform.pas"/>
|
<Filename Value="..\shared\sformatsettingsform.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="FormatSettingsForm"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="sFormatsettingsForm"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="..\shared\ssortparamsform.pas"/>
|
<Filename Value="..\shared\ssortparamsform.pas"/>
|
||||||
@ -93,6 +98,7 @@
|
|||||||
<Filename Value="..\shared\scurrencyform.pas"/>
|
<Filename Value="..\shared\scurrencyform.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ComponentName Value="CurrencyForm"/>
|
<ComponentName Value="CurrencyForm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="scurrencyform"/>
|
<UnitName Value="scurrencyform"/>
|
||||||
</Unit5>
|
</Unit5>
|
||||||
|
@ -7,8 +7,8 @@ uses
|
|||||||
cthreads,
|
cthreads,
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Interfaces, // this includes the LCL widgetset
|
Interfaces, // this includes the LCL widgetset
|
||||||
Forms, main, scsvparamsform, sformatsettingsform,
|
Forms, main,
|
||||||
ssortparamsform, scurrencyform
|
scsvparamsform, sformatsettingsform, ssortparamsform, scurrencyform
|
||||||
{ you can add units after this };
|
{ you can add units after this };
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
@ -320,6 +320,7 @@ implementation
|
|||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
LCLProc, // debugln
|
||||||
fpsUtils, fpsCSV,
|
fpsUtils, fpsCSV,
|
||||||
sCSVParamsForm, sCurrencyForm, sFormatSettingsForm, sSortParamsForm;
|
sCSVParamsForm, sCurrencyForm, sFormatSettingsForm, sSortParamsForm;
|
||||||
|
|
||||||
@ -328,6 +329,8 @@ uses
|
|||||||
|
|
||||||
{ Loads the spreadsheet file selected by the AcFileOpen action }
|
{ Loads the spreadsheet file selected by the AcFileOpen action }
|
||||||
procedure TMainForm.AcFileOpenAccept(Sender: TObject);
|
procedure TMainForm.AcFileOpenAccept(Sender: TObject);
|
||||||
|
var
|
||||||
|
t: TTime;
|
||||||
begin
|
begin
|
||||||
WorkbookSource.AutodetectFormat := false;
|
WorkbookSource.AutodetectFormat := false;
|
||||||
case AcFileOpen.Dialog.FilterIndex of
|
case AcFileOpen.Dialog.FilterIndex of
|
||||||
@ -340,7 +343,10 @@ begin
|
|||||||
7: WorkbookSource.FileFormat := sfOpenDocument; // Open/LibreOffice
|
7: WorkbookSource.FileFormat := sfOpenDocument; // Open/LibreOffice
|
||||||
8: WorkbookSource.FileFormat := sfCSV; // Text files
|
8: WorkbookSource.FileFormat := sfCSV; // Text files
|
||||||
end;
|
end;
|
||||||
|
t := now;
|
||||||
WorkbookSource.FileName := UTF8ToAnsi(AcFileOpen.Dialog.FileName); // this loads the file
|
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;
|
UpdateCaption;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user