AGB  ·  Datenschutz  ·  Impressum  







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

Random: Delphi vs. Lazarus?

Ein Thema von AlexII · begonnen am 30. Jan 2014 · letzter Beitrag vom 7. Feb 2014
Antwort Antwort
Furtbichler
(Gast)

n/a Beiträge
 
#1

AW: Random: Delphi vs. Lazarus?

  Alt 1. Feb 2014, 09:37
Früher ging Randomize mal auf GetTickCount, welches meistens in einem Intervall von 16 Millisekunden hochzählte. (glaub ich)
GetTickCount zählt zumindest auf NT Systemen in Millisekunden hoch, da es auf dem genaueren internen Counter des Kernels aufsetzt, siehe auch hier, Zeile 445.
Hab ich kein NT-System? Na, zumindest habe ich kein ReactOS.
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  c0,c,c1 : Cardinal;

begin
  c := GetTickCount;
  c0 := c;
  repeat
    c1 := GetTickCount;
    if c<>c1 then begin
      memo1.lines.add(intToStr(c-c0));
      c := c1;
    End;
  until c1-c0>100;
end;
Zitat von MemoBox1:
0
15
31
47
62
78
93
16ms war schon immer so.
  Mit Zitat antworten Zitat
hathor
(Gast)

n/a Beiträge
 
#2

AW: Random: Delphi vs. Lazarus?

  Alt 1. Feb 2014, 11:42
"The resolution of the GetTickCount function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds."

http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
  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 03:38 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