AW: Windows.GetTickCount64 auch unter Windows XP?
Ist vielleicht "Off-topic", aber das TStopwatch gäbe es auch noch.
Nehme ich mittlerweile lieber statt der GetTickCounts, ist auch CrossPlatform :stupid: Rollo |
AW: Windows.GetTickCount64 auch unter Windows XP?
Kann man demnach die oben genannten Routinen statt GetTickCount(64) verwenden oder eher nicht?
|
AW: Windows.GetTickCount64 auch unter Windows XP?
Zitat:
Früher (vielleicht auch teilweise noch heute) hatte jeder CPU-Kern seinen eigenen Tickcounter * Problem: Windowsch schiebt standardmäßig die Programme umher, also wenn du den ersten TickCount nimmst und mit einem zweiten verrechnest (Differenz), dann kann da schnell Mist raus kommen, wenn zwischendurch dein Programm (der Thread) auf einen anderen Kern verschoben wurde. Daher gingen viele CPU-Hersteller dazu über einen "virtuellen" globalen TickCount zu nehmen, der mit keinem der Kerne übereinstimmt. Außerdem werden häufig die CPUs/Kerne zur Laufzeit lastabhängig getacktet. Fazit: dieser der CPU-TickCount stimmt nicht mehr mit den Ticks (ausgeführten Aktionen auf dem Kern) der Kerne überein. Und bezüglich Echtzeitsystem ... jupp, jede Anwendung/Thread hat einen TimeSlot und wirt zwischendurch immer mal wieder pausiert, während andere Prozesse/Threads auf dem Kern rechnen dürfen. |
AW: Windows.GetTickCount64 auch unter Windows XP?
Zu RDTSC:
Zitat:
|
AW: Windows.GetTickCount64 auch unter Windows XP?
Ich habe hier vier Beiträge gelöscht, die in einer völligen Entgleisung endeten.
|
AW: Windows.GetTickCount64 auch unter Windows XP?
ich nutz QueryPerformanceCounter immer wenn ich was benche, ich finde es sehr präzise.
Nur als vergleich gegen GetTickCount egal ob x86 oder x64. Als alternative halt. Ich hoffe der code ist mit neueren delphi versionen kompatibel.
Delphi-Quellcode:
{QueryPerformanceCounter uses the PC's clock counter just as GetTickCount, but it
reads the current value of the countdown register in the timer chip to gain more accuracy -- down to 1.193MHz (about 800ns). However, it takes 5 to 10us to call QueryPerformanceCounter, because it has to do several port I/O instructions to read this value. If you are running multiprocessor NT, QueryPerformanceCounter uses the Pentium cycle counter. You should not be using the raw value of QueryPerformanceCounter; you should always divide by QueryPerformanceFrequency to convert to some known time base. QueryPerformanceCounter doesn't run at the same rate on all machines. The example below shows how to use it in Delphi 3/4: } type TInt64 = TLargeInteger; var Frequency, lpPerformanceCount1, lpPerformanceCount2 : TLargeInteger; begin QueryPerformanceCounter(TInt64((@lpPerformanceCount1)^)); // activity to measure my_proc; QueryPerformanceCounter(TInt64((@lpPerformanceCount2)^)); QueryPerformanceFrequency(TInt64((@Frequency)^)); // this shows the time in ns ShowMessage(IntToStr(Round(1000000 * (lpPerformanceCount2.QuadPart - lpPerformanceCount1.QuadPart) / Frequency.QuadPart))); end; |
AW: Windows.GetTickCount64 auch unter Windows XP?
Hallo,
OK, Info zur Starter-Edition gelöscht. Kennt ja wohl jeder mittlerweise. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:24 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