unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Label1: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Image1: TImage;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
startzeit,
endzeit : Cardinal;
Zeitsumme: TDateTime;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
If (Button1.Caption = '
Start')
then
begin
startzeit := GetTickCount;
Button1.Caption := '
Stop';
label1.Caption := '
Die Uhr läuft!!';
end
else
begin
endzeit := GetTickCount;
label1.Caption := Format ('
Die Stopuhr lief %d ms.',[endzeit-startzeit]);
Button1.Caption := '
Start';
IF (endzeit-startzeit = 10000)
THEN (Label3.Caption := '
Gewonnen');
IF (endzeit-startzeit < 10000)
THEN (Label3.Caption := '
Verloren! - Zu schnell!');
IF (endzeit-startzeit > 10000)
THEN (Label3.Caption := '
Verloren! - Zu langsam!');
end;
end;
end.