Autor Beitrag
syox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

WinXP, Debian GNU/Linux mit 2.6.13er Kernel
Visual Studio 6 (C/C++), , Borland Delphi 2005 Prof. (Delphi), Quanta+ (Perl, HTML, CSS)
BeitragVerfasst: Mi 12.10.05 09:53 
Hallo zusammen

bin leider noch feucht hinter den Ohren was Delphi und .NET betrifft. Die Kombination lässt mich aber zZ. schwimmen..
Ich möchte eine Zeiterfassung realisieren:
1. Timer_Starten
2. <ZeitaufwendigesZeugs>
3. Timer_Stoppen
4. Gebrauchte Zeit ausgeben
^^ das ganze hab ich bereits in Delphi 7 gefunden sogar mit ner 0.01 Sekunden genauen Auflösung.

Problem ist: Das ganze läuft in einer Delphi WinForms-Anwendung für .NET
da hab ich bisher noch keinen Ansatz gefunden :/
syox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

WinXP, Debian GNU/Linux mit 2.6.13er Kernel
Visual Studio 6 (C/C++), , Borland Delphi 2005 Prof. (Delphi), Quanta+ (Perl, HTML, CSS)
BeitragVerfasst: Mi 12.10.05 11:52 
Sick Bastard von coding-board.de schrieb:
------------------------------------
System.Windows.Forms.Timer;
System.Threading.Timer;
und im .NET Framework 2.0 auch:
System.Diagnostics.Stopwatch;
------------------------------------

^^ das wären schonmal zweidrei Gedanken
Master_BB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 90



BeitragVerfasst: Fr 21.10.05 11:41 
also ich hab noch ne bessere Variante womit du keinen Timer benötigst.

Und zwar brauchst du 2 DateTime Objekte und ein
tolles TimeSpan Objekt.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  ATime1 : DateTime;
  ATime2 : DateTime;
  ASpan  : TimeSpan;
begin
  ATime1 := DateTime.Create(DateTime.Now.Today.Ticks);
  //3000 zeilen code
  ATime2 := DateTime.Create(DateTime.Now.Today.Ticks);
  ASpan  := ATime2 - ATime1;
end;


so mit dem code kannst du die zeitspanne berechnen
die das programm brauchst zwischen Time1 und Time2
syox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

WinXP, Debian GNU/Linux mit 2.6.13er Kernel
Visual Studio 6 (C/C++), , Borland Delphi 2005 Prof. (Delphi), Quanta+ (Perl, HTML, CSS)
BeitragVerfasst: Fr 21.10.05 14:16 
:):)

danke

wie genau ist die Sache denn?
Werde das ma demnächst testen, z.Z. reicht mir die Implementation der HighPerformanceTimer (is aba unmanaged... also doof)
Master_BB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 90



BeitragVerfasst: Fr 21.10.05 18:11 
naja es ist so genau wie DateTime,
das heißt
Tage, Stunden, Minuten, Sekunden, Millisekunden, Ticks
usw

millisekunden sollten doch reichen oder?

ist performance sparender als dein Timer
syox Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

WinXP, Debian GNU/Linux mit 2.6.13er Kernel
Visual Studio 6 (C/C++), , Borland Delphi 2005 Prof. (Delphi), Quanta+ (Perl, HTML, CSS)
BeitragVerfasst: Mo 24.10.05 08:52 
DateTime is genau genug *g* 8)