- 4.80.1.7. -
Table of Contents
4. Standard Units
4.80. ZenTimer - Full-featured ZTimer Library
4.80.1. ZenTimer Unit Procedures and Functions
4.80.1.7. LZTimerCount function
4.80.1.7. LZTimerCount function
Targets: MS-DOS, OS/2, Win32
ZenTimer Unit
Returns the current count for the Long Period Zen Timer.
Declaration:
function LZTimerCount: Dword;
Remarks:
Returned value is a current count that has elapsed between
calls to LZTimerOn and
LZTimerOff in microseconds.
Example:
program LZTest;
{$ifndef __CON__}
This program must be compiled for MS-DOS, OS/2 or Win32 console mode
{ $endif}
uses ZenTimer;
function lu06(val: Longint): String;
var
i: Longint;
s: String;
begin
Str(val:6,s);
for i := 1 to 6 do
if s[i] = ' ' then s[i]:= '0';
lu06 := s;
end;
procedure ReportTime(count: Longint);
var
secs: Longint;
begin
secs := count div 1000000;
count := count - secs * 1000000;
Writeln('Time taken: ', secs, '.', lu06(count), ' seconds');
end;
var
i, j: DWord;
begin
LZTimerOn;
for j := 0 to 9 do
for i := 0 to 19999 do
i := i; // do something
LZTimerOff;
ReportTime(LZTimerCount);
end.
- 4.80.1.7. -