Previous: LZDelay procedure To the Table of Content Next: LZTimerLap function

- 4.75.1.7 -
Standard Units
ZenTimer Unit
ZenTimer Unit Procedures and Functions

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 LZTiemerOn and LZTiemerOff 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.



Previous: LZDelay procedure To the Table of Content Next: LZTimerLap function
LZDelay procedure Table of Content LZTimerLap function

- 4.75.1.7 -