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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user