summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2009-10-01 17:23:38 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2009-10-01 17:23:38 +0200
commit916c18962318796f8f0f31af138c4db749461ac7 (patch)
tree0abbfba76bce0dce973e07ea7bf844a88b50ef2e /src
parent1580df25724ca9e27f9a58675d305c5cad697831 (diff)
downloadfpGUI-916c18962318796f8f0f31af138c4db749461ac7.tar.xz
Added EpikTimer for performance timing. Just a temporary thing.
Diffstat (limited to 'src')
-rw-r--r--src/HelpFile.pas1
-rw-r--r--src/frm_main.pas24
-rw-r--r--src/newview_fpgui.lpi8
-rw-r--r--src/newview_fpgui.lpr4
-rw-r--r--src/nvUtilities.pas2
5 files changed, 27 insertions, 12 deletions
diff --git a/src/HelpFile.pas b/src/HelpFile.pas
index 4f4de9f6..806fd042 100644
--- a/src/HelpFile.pas
+++ b/src/HelpFile.pas
@@ -240,7 +240,6 @@ begin
for EntryIndex := 0 to _Header.ntoc-1 do
begin
pEntry := _Data + tocarray[EntryIndex];
- writeln('pEntry^.length = ', IntToStr(pEntry^.Length) + ' NumSlots=' + IntToStr(pEntry^.numSlots));
Topic := TTopic.Create( _Data,
_Header,
_Dictionary,
diff --git a/src/frm_main.pas b/src/frm_main.pas
index 75b6f9a9..20cad3ff 100644
--- a/src/frm_main.pas
+++ b/src/frm_main.pas
@@ -105,18 +105,28 @@ const
implementation
uses
- fpg_dialogs, fpg_constants, nvUtilities, HelpTopic;
+ fpg_dialogs, fpg_constants, nvUtilities, HelpTopic, EpikTimer;
{@VFD_NEWFORM_IMPL}
procedure TMainForm.MainFormShow(Sender: TObject);
+var
+ s, e: TDateTime;
+ t: TEpikTimer;
begin
bvlBody.Realign;
if Paramcount > 0 then
begin
+ t := TEpikTimer.Create(nil);
+ t.Start;
+// s := now;
OpenFile(ParamStr(1));
+// e := now;
+ t.Stop;
+ writeln(t.ElapsedDHMS);
+// writeln(FormatDateTime('mm:ss.zz', e-s));
end;
end;
@@ -489,7 +499,7 @@ var
HelpFile: THelpFile;
Topic: TTopic;
Begin
- writeln('DisplayTopic >>>>');
+ ProfileEvent('DisplayTopic >>>>');
if tvContents.Selection = nil then
begin
ShowMessage('You must select a topic first by clicking it.');
@@ -497,23 +507,23 @@ Begin
end
else
Topic := TTopic(tvContents.Selection.Data);
- writeln('Got Topic from Treeview');
+ ProfileEvent('Got Topic from Treeview');
Memo1.Lines.Clear;
ImageIndices := TList.Create;
- writeln('Cleared memo...');
+ ProfileEvent('Cleared memo...');
HelpFile := TopicFile(Topic);
if HelpFile = nil then
raise Exception.Create('Failed to get active HelpFile from Topic');
if HelpFile.HighlightWords <> nil then
- writeln('highlightwords is ok');
+ ProfileEvent('highlightwords is ok');
Text := nil;
- writeln('Debug = ', Debug);
+ ProfileEvent('Debug = ' + BoolToStr(Debug));
if ImageIndices <> nil then
- writeln('ImageIndices initialized');
+ ProfileEvent('ImageIndices initialized');
Topic.GetText(HelpFile.HighlightWords,
Debug,
Text,
diff --git a/src/newview_fpgui.lpi b/src/newview_fpgui.lpi
index dbdefa59..fc6c00ff 100644
--- a/src/newview_fpgui.lpi
+++ b/src/newview_fpgui.lpi
@@ -32,7 +32,7 @@
<PackageName Value="fpgui_toolkit"/>
</Item1>
</RequiredPackages>
- <Units Count="13">
+ <Units Count="14">
<Unit0>
<Filename Value="newview_fpgui.lpr"/>
<IsPartOfProject Value="True"/>
@@ -98,12 +98,18 @@
<IsPartOfProject Value="True"/>
<UnitName Value="nvNullObjects"/>
</Unit12>
+ <Unit13>
+ <Filename Value="../../../../../../opt/git/dunit2/3rdparty/epiktimer/epiktimer.pas"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="EpikTimer"/>
+ </Unit13>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)/"/>
+ <OtherUnitFiles Value="/opt/git/dunit2/3rdparty/epiktimer/"/>
<UnitOutputDirectory Value="units"/>
</SearchPaths>
<Parsing>
diff --git a/src/newview_fpgui.lpr b/src/newview_fpgui.lpr
index 08827df8..a43c80bd 100644
--- a/src/newview_fpgui.lpr
+++ b/src/newview_fpgui.lpr
@@ -6,8 +6,8 @@ uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
- Classes, fpg_main, frm_main, DataTypes, HelpFileHeader, HelpWindow, IPFEscapeCodes,
- HelpTopic, CompareWordUnit, SearchTable, TextSearchQuery, nvUtilities,
+ Classes, EpikTimer, fpg_main, frm_main, DataTypes, HelpFileHeader, HelpWindow,
+ IPFEscapeCodes, HelpTopic, CompareWordUnit, SearchTable, TextSearchQuery, nvUtilities,
nvNullObjects, HelpFile;
diff --git a/src/nvUtilities.pas b/src/nvUtilities.pas
index 1af9b6cf..a3315f1e 100644
--- a/src/nvUtilities.pas
+++ b/src/nvUtilities.pas
@@ -3,7 +3,7 @@ unit nvUtilities;
{$mode objfpc}{$H+}
// disable to remove debugging output
-{$Define DEBUG}
+{.$Define DEBUG}
interface