hier nochmal eine Timer-Frage.
Wenn ich den TTimer nicht benutzen will, sondern stattdessen GetTickCount und repeat until, so wie hier ungefähr (es sollen 3 mal hintereinander 3 Zeiten gemessen und ausgegeben sowie eine Bild ein- und ausgeblendet werden):
Code: Alles auswählen
procedure TForm1.Button1Click(Sender: TObject);
begin
nochmehr;
end;
procedure TForm1.nochmehr;
begin
repeat
mehr;
until y=3;
Label1.Caption:='Ende.';
end;
procedure TForm1.mehr;
begin
t1:=GetTickCount;
x:=0;
Inc(y);
repeat
t2:=GetTickCount;
until (t2-t1)>=800;
tdiff[y]:=(t2-t1);
Inc(x);
Form1.Caption:='Nr. '+IntToStr(x)+' / Zeit: '+IntToStr(tdiff[y]);
Label1.Caption:=IntToStr(tdiff[y]);
Image1.Visible:=True;
repeat
t3:=GetTickCount;
until (t3-t2)>=900;
tdiff[y]:=(t3-t2);
Inc(x);
Form1.Caption:='Nr. '+IntToStr(x)+' / Zeit: '+IntToStr(tdiff[y]);
Label1.Caption:=IntToStr(tdiff[y]);
Image1.Visible:=False;
repeat
t4:=GetTickCount;
until (t4-t3)>=1000;
tdiff[y]:=(t4-t3);
Inc(x);
Form1.Caption:='Nr. '+IntToStr(x)+' / Zeit: '+IntToStr(tdiff[y]);
Label1.Caption:=IntToStr(tdiff[y]);
Image1.Visible:=True;
end;
Jemand eine Idee?
Vielen Dank und viele Grüße,
Eva