unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Button1: TButton;
    Button2: TButton;
    Timer1: TTimer;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
var h,m,s:integer;
procedure TForm1.Button1Click(Sender: TObject);
begin
timer1.Enabled:=true;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
timer1.Enabled:=false;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
h:=0;
m:=0;
s:=0;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
s:=s+1;
label1.Caption:=intTostr(s);
if(s=59) then
begin
s:=0;
m:=m+1;
label2.Caption:=intTostr(m);
end;
if(m=59) then
begin
m:=0;
h:=h+1;
label3.Caption:=intTostr(h);
end;
end;

end.
