AGB  ·  Datenschutz  ·  Impressum  







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

timeGetTime

Ein Thema von Luckie · begonnen am 11. Jan 2010 · letzter Beitrag vom 11. Jan 2010
Antwort Antwort
Seite 3 von 3     123   
Benutzerbild von p80286
p80286

Registriert seit: 28. Apr 2008
Ort: Stolberg (Rhl)
6.659 Beiträge
 
FreePascal / Lazarus
 
#21

Re: timeGetTime

  Alt 11. Jan 2010, 15:58
Ich hab nochmal, unter veränderten Bedingungen gemessen:

Tick 23725718, Time 23725718, DeltaTick 78, DeltaTime 80
Tick 23725796, Time 23725798, DeltaTick 78, DeltaTime 80
Tick 23725875, Time 23725876, DeltaTick 79, DeltaTime 78
Tick 23725953, Time 23725953, DeltaTick 78, DeltaTime 77
Tick 23726031, Time 23726029, DeltaTick 78, DeltaTime 76
Tick 23726109, Time 23726104, DeltaTick 78, DeltaTime 75
Tick 23726187, Time 23726178, DeltaTick 78, DeltaTime 74
Tick 23726250, Time 23726252, DeltaTick 63, DeltaTime 74
Tick 23726328, Time 23726324, DeltaTick 78, DeltaTime 72
Tick 23726390, Time 23726395, DeltaTick 62, DeltaTime 71
Tick 23726468, Time 23726466, DeltaTick 78, DeltaTime 71
Tick 23726531, Time 23726535, DeltaTick 63, DeltaTime 69
Tick 23726609, Time 23726603, DeltaTick 78, DeltaTime 68
Tick 23726671, Time 23726671, DeltaTick 62, DeltaTime 68
Tick 23726734, Time 23726737, DeltaTick 63, DeltaTime 66
Tick 23726796, Time 23726802, DeltaTick 62, DeltaTime 65
Tick 23726875, Time 23726867, DeltaTick 79, DeltaTime 65
Tick 23726937, Time 23726930, DeltaTick 62, DeltaTime 63
Tick 23727000, Time 23726994, DeltaTick 63, DeltaTime 64
Tick 23727062, Time 23727056, DeltaTick 62, DeltaTime 62
Tick 23727125, Time 23727118, DeltaTick 63, DeltaTime 62
Tick 23727187, Time 23727178, DeltaTick 62, DeltaTime 60
Tick 23727234, Time 23727238, DeltaTick 47, DeltaTime 60
Tick 23727296, Time 23727297, DeltaTick 62, DeltaTime 59
Tick 23727359, Time 23727354, DeltaTick 63, DeltaTime 57
Tick 23727406, Time 23727411, DeltaTick 47, DeltaTime 57
Tick 23727468, Time 23727467, DeltaTick 62, DeltaTime 56
Tick 23727515, Time 23727521, DeltaTick 47, DeltaTime 54
Tick 23727578, Time 23727575, DeltaTick 63, DeltaTime 54
Tick 23727625, Time 23727628, DeltaTick 47, DeltaTime 53
Tick 23727687, Time 23727679, DeltaTick 62, DeltaTime 51
Tick 23727734, Time 23727730, DeltaTick 47, DeltaTime 51
Tick 23727781, Time 23727780, DeltaTick 47, DeltaTime 50
Tick 23727828, Time 23727829, DeltaTick 47, DeltaTime 49
Tick 23727875, Time 23727877, DeltaTick 47, DeltaTime 48
Tick 23727921, Time 23727924, DeltaTick 46, DeltaTime 47
Tick 23727968, Time 23727969, DeltaTick 47, DeltaTime 45
Tick 23728015, Time 23728014, DeltaTick 47, DeltaTime 45
Tick 23728062, Time 23728058, DeltaTick 47, DeltaTime 44
Tick 23728109, Time 23728100, DeltaTick 47, DeltaTime 42
Tick 23728140, Time 23728141, DeltaTick 31, DeltaTime 41
Tick 23728187, Time 23728181, DeltaTick 47, DeltaTime 40
Tick 23728218, Time 23728220, DeltaTick 31, DeltaTime 39
Tick 23728265, Time 23728259, DeltaTick 47, DeltaTime 39

wobei ich folgende Änderung eingebaut habe:
Delphi-Quellcode:
Sleep(i+30);
Dec(i);
daraus würde ich schließen, unter 100Millisec ist Timegettime genauer als getTickCount.

Was die Abweichung d2006/D7 angeht würde ich es auf die implementierung von Writeln / Format und ggf. abweichende Compileroptionen schieben (Bin mir da zwar keiner Schuld bewußt aber könnte ja sein)

Gruß
K-H
Programme gehorchen nicht Deinen Absichten sondern Deinen Anweisungen
R.E.D retired error detector
  Mit Zitat antworten Zitat
Benutzerbild von markus5766h
markus5766h

Registriert seit: 5. Mär 2009
Ort: Hamburg
569 Beiträge
 
Delphi XE8 Professional
 
#22

Re: timeGetTime

  Alt 11. Jan 2010, 16:51
Hallo,
als Konsolenanwendung waren meine "Tick"-Werte schön konstant,
als Windows-Anwendung variiren sie stark, siehe Anhang

Delphi-Quellcode:
uses
  Windows, mmsystem, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids;

type
  TForm1 = class(TForm)
    Grid1: TStringGrid;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    Times : array[1..4, 0..50] of Cardinal;
    LastTick, LastTime : Cardinal;
    procedure SetTimes;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.SetTimes;
var
 i : Integer;
begin
 LastTick := 0;
 LastTime := 0;
 i := 50;

 while (i > 0) do
  begin
   Times[1, i] := GetTickCount;
   Times[2, i] := TimeGetTime;
   Times[3, i] := Times[1, i] - LastTick;
   Times[4, i] := Times[2, i] - LastTime;
   LastTick := Times[1, i];
   LastTime := Times[2, i];
   Sleep(53);
   Dec(i);
  end; // end i > 0
end;

procedure TForm1.Button1Click(Sender: TObject);
var
 c, r : Integer;
begin
SetTimes;
Grid1.Cells[1, 0] := 'Tick';
Grid1.Cells[2, 0] := 'Time';
Grid1.Cells[3, 0] := 'Tick-LastTick';
Grid1.Cells[4, 0] := 'Time-LastTime';

for r := 0 to 50 do
 begin
  Grid1.Cells[0, r+1] := IntToStr(r);
   for c := 1 to 4 do
    begin
     Grid1.Cells[c, r+1] := IntToStr(Times[c, 50-r]);
    end;
 end;
end;
Miniaturansicht angehängter Grafiken
projekt14_206.jpg   projekt4_120.jpg  
Markus H.
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 3 von 3     123   


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 02:05 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