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

@@ -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;