AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Transfer time values

Ein Thema von sdean · begonnen am 9. Jun 2010 · letzter Beitrag vom 9. Jun 2010
Antwort Antwort
sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#1

Transfer time values

  Alt 9. Jun 2010, 18:52
Delphi-Version: 2005
Hi , i want to Transfer an Elapsed time from timer to an other time ;

i use the following code to calc the Elapsed Time :

Delphi-Quellcode:
procedure TForm1.Time1Timer(Sender: TObject);
var
    s: string;
    TotalTime: TDateTime;
    DLTimes: Double;
    Hh, Mh, sSec, MSs: Word;
begin
TotalTime:= Now-FStartTime;


  DecodeTime(TotalTime, hH, Mh, sSec, MSs);
  sSec := sSec + Mh * 60 + hH * 3600;
   DLTimes := sSec + MSs / 1000;
  s:=Format('%2d:%2d:%2d', [sSec div 3600, (sSec div 60) mod 60, sSec mod 60]);
FElapsedTime:=FormatDateTime('hh:nn:ss', StrToTime(s));
end
So what i want to do is : when i stop timer1 and start timer2 then
timer2 will continue incrementing the FElapsedTime value .

let me suppose this :

when i stopped timer1 the FElapsedTime value was : 00:50:00 ; then when i start Timer2 the FElapsedTime value will be 00:51:00 ....etc incrementing the FElapsedTime value .


thank you
  Mit Zitat antworten Zitat
idefix2

Registriert seit: 17. Mär 2010
Ort: Wien
1.027 Beiträge
 
RAD-Studio 2009 Pro
 
#2

AW: Transfer time values

  Alt 9. Jun 2010, 20:18
When timer 1 is started, you save the start time:
Timer1starttime := now; When timer 1 is stopped:

elapsedtime1 := now - timer1starttime; When timer 2 is started, again you save the starttime

timer2starttime := now; When time 2 stops, elapsed time is:

elapsedtime2 := now-timer2starttime; Total elapsed time is

totalelapsedtime := elapsedtime1 + elapsedtime2;

Geändert von mkinzler ( 9. Jun 2010 um 20:21 Uhr) Grund: Delphi-Tags eingefügt
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz