Autor Beitrag
Delphi-Zone
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 7
Delphi 7.0 Prof
BeitragVerfasst: Do 23.09.10 15:35 
Hallo,

Ich möchte meine Stoppuhr in meinem spiel nicht in milliesekunden. (was er automatisch macht)
Sondern in Sekunden.

Ich hab schon alles durch gesucht, aber ich hab noch keine quellcode dafür gefunden.

Wäre nett wenn ihr mir da helft.


Gruß Tom
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 23.09.10 15:37 
Wie wäre es, die Zeit in Millisekunden durch 1000 zu teilen? Dann hat man doch die Zeit in Sekunden. :gruebel:

_________________
We are, we were and will not be.
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Do 23.09.10 15:44 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.Button1Click(Sender: TObject);
begin
  FTC := getTickCount;
  Timer1.Enabled := not Timer1.Enabled;
  if not Timer1.Enabled  then
      begin
        label1.Font.Color := clRed;
      end
  else label1.Font.Color := clBlack;


end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
   label1.Caption := IntToStr( (GetTickCount - FTC) div 1000);
end;

Für diesen Beitrag haben gedankt: Delphi-Zone
Delphi-Zone Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 7
Delphi 7.0 Prof
BeitragVerfasst: Do 23.09.10 15:56 
Danke! Jetzt hab ich es!!!

Gruß Tom