Skip to content

Commit ff73799

Browse files
committed
Minor tweak to Delphi Timer utility
1 parent 3f4bc09 commit ff73799

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

Delphi/BenchMark/DelphiBenchmark.dpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ begin
5050
clip[0] := MakeRandomPath(maxWidth, maxHeight, edgeCount);
5151

5252
begin
53-
DoTimer(timerResult);
53+
InitTimer(timerResult);
5454
solution := Intersect(subj, clip, frNonZero);
5555
end;
5656
timeTotal := timeTotal + timerResult;

Delphi/Utils/Timer.pas

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ interface
66
Windows,
77
SysUtils;
88

9+
(*******************************************************************************
10+
* Example: *
11+
* *
12+
* var *
13+
* time: double; *
14+
* begin *
15+
* ... *
16+
* begin *
17+
* InitTimer(time); *
18+
* DoSomeLengthyOp(); *
19+
* end; *
20+
* Caption := Format('DoSomeLengthyOp took %1.3n secs', [time]); *
21+
* .... *
22+
* end; *
23+
*******************************************************************************)
24+
925
{$IFDEF FPC}
1026
{$MODE DELPHI}
1127
{$ENDIF}
@@ -16,7 +32,7 @@ interface
1632
['{A50173E8-6497-4F83-B4A8-9C0D5D709834}']
1733
end;
1834

19-
function DoTimer(out timeResult: double): ITimer;
35+
function InitTimer(out timeResult: double): ITimer;
2036

2137
implementation
2238

@@ -81,7 +97,7 @@ class function TTimer.Release(Inst: PTimerData): Integer; stdcall;
8197
Dispose(Inst);
8298
end;
8399

84-
function DoTimer(out timeResult: double): ITimer;
100+
function InitTimer(out timeResult: double): ITimer;
85101
var
86102
timer: PTimerData;
87103
begin

0 commit comments

Comments
 (0)