uses
  Crt,
  Timer;
var
  Tm  : tTimer;
  i   : Integer;
  y,x : Word;
begin
  ClrScr;
  WriteLn;
  TextAttr:=$07;
  WriteLn('Test jednotky Timer.');
  WriteLn;
  x:=WhereX;
  y:=WhereY;
  Tm.SaveTime;
  with Tm do
  repeat
    GotoXY(x,y);
    TextAttr:=$07;
    Write('Cas v milisec = ');
    for i:=0 to 10 do
    begin
      if TstTime(i*1000) then
        TextAttr:=$0c
      else
        TextAttr:=$09;
      Write(i*1000,'  ');
    end;
    Delay(200);
    GotoXY(X,Y+1);
    TextAttr:=$07;
    write('Uplynulo jiz ',ReadTime,' ms.        ');
  until TstTime(11000) or keypressed;
  TextAttr:=$07;
  GotoXY(X,Y+3);
  writeln('Test Count - testuji 10000 ms');
  tm.setcount(10000);
  writeln('Ted zacal');
  TextAttr:=$09;
  for i:=0 to 50 do
  begin
    GotoXY(i,Y+4);
    write('#');
  end;
  TextAttr:=$07;
  repeat;
    GotoXY(X,Y+5);
    writeln('Zbyva jeste ',Tm.ReadCount,' milisekud.   ');
    GotoXY(Round(Tm.ReadCount/200),Y+4);
    write(' ');
    delay(200);
  until tm.tstcount or keypressed;
  GotoXY(X,Y+5);
  writeln('Prave skoncil                    ');
end.