Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Mi 22.10.03 23:03 
Hallo Leute !

ich möchte eine zeit anzeigen lassen das mir sagt wie lange das Programm läuft, also einen timer der immer mitangezeigt wird, wenn das programm aktiv ist...also, wie eine "Stoppuhr"! wie mache ich das ???

Moderiert von user profile iconTino: Titel geändert.
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mi 22.10.03 23:07 
pack am ebsten einen timer auf die Form, der ab dem Programmstart aktiv ist, und erhöhe bei jedem Timer-OnTimer-Ereignis eine Globale "TimeSiceStart:Integer=0" Variable um 1 (timer.intervall:=1000)
dann nur noch diesen wert bei bedarf anzeigen (ggf. in Minuten und Stunden umrechnen...)
ausblenden Quelltext
1:
label1.text:=inttostr(timesincestart);					
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 22.10.03 23:08 
In OnCreate:

ausblenden Delphi-Quelltext
1:
 StartZeit := GetTickCount;					


und im Timer:

ausblenden Delphi-Quelltext
1:
 LaufZeit := GetTickCount-StartZeit;					


StartZeit ist DWORD oder Cardinal.
Das Ergebnis ist in ms
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 23.10.03 07:32 
und wie rechne ich mit dem timcesincestart in minuten und stunden um ???
ich will das es so angezeigt wird "00:00:00" und das soll dann immer weiterzählen !
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Do 23.10.03 08:34 
Sieh mal in der Onlinehilfe unter Datum/Zeit (Routinen) nach.

barfuesser
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Do 23.10.03 09:50 
ausblenden Quelltext
1:
2:
3:
Stunden:=trunc(timesincestart/3600);
Minuten:=trunc((timesincestart-stunden*3600)/60);
Sekunden:=timesincestart-(stunden*3600+Minuten*60);


bin mir nicht ganz sicher ob das klappt, habe hier am Rechner aber auch kein Delphi... bitte einer überprüfen ;)

sollte aber so oder so ähnlich funktionieren :mrgreen:

P.S. es gibt natürlich auch eigene Delphi-Routinen dafür...
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 23.10.03 10:09 
GetCurrentProcess + GetProcessTimes (nur NT)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!