| |
|
|
Michael W. | Hab' une kleine perle de Ragnar Rehbein wieder trouvé
// angepasst à vX3
Cls
Def QPF(1 ) !"KERNEL32","QueryPerformanceFrequency"' rückgabe comme LARGE_INTEGER
Def QPC(1 ) !"KERNEL32","QueryPerformanceCounter"' rückgabe comme LARGE_INTEGER
Set("Décimal",0)
Déclarer mem time
Faible time, 16
QPF(time)// dépendant vom cpu-la mesure
Imprimer "HiPerfFreq.: ", Str$(Long(time,0)) + " " + Str$(Long(time,8))
WhileLoop 200
AddStrings "HiPerfTimer: " + Str$(Long(time,0)) + " " + Str$(Long(time,8)) + " Tickc.: " + Str$(&GetTickCount)
QPC(time)
Endwhile
ListBox$("QueryPerformanceCounter",2)
Dispose time
' ---------
' --------- ...weitere Fundstelle...
' ---------
'source: https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx
ClearList 0
Déclarer quad Frequency, StartingTime, EndingTime, ElapsedMicroSeconds
Déclarer quad stops[]
Déclarer int schleifen, OneSec
schleifen = 20000
OneSec = 0
Imprimer "\n...et eh bien " + Str$(schleifen) + " Durchläufe (sur 12.000 pour une sec.)"
QPF(Addr(Frequency))
QPC(Addr(StartingTime))
WhileLoop 1,schleifen
QPC(Addr(EndingTime))
stops[&Boucle] = EndingTime
Endwhile
Imprimer "\n...et Aufbereitung"
WhileLoop 1,schleifen
ElapsedMicroseconds = stops[&Boucle] - StartingTime
ElapsedMicroseconds = ElapsedMicroseconds * 1000000
ElapsedMicroseconds = ElapsedMicroseconds / Frequency
AddStrings "Timer: " + Format $("%8.0f µs",ElapsedMicroseconds) + Format $(" %8.3f ms",ElapsedMicroseconds/1000) + Format $(" %8.6f s --- ",ElapsedMicroseconds/1000000)+ Format $("000000",&Boucle)
Si non OneSec
Si (ElapsedMicroseconds/1000000) >= 1.0
Inc OneSec
Imprimer "(ca. " + Str$(&Boucle - 1) + " Durchläufe dans 1 sec.)"
EndIf
EndIf
Endwhile
Imprimer "\n...et Anzeige"
Imprimer "ENDE"
ListBox$("QueryPerformanceCounter",2)
ClearList 0
Fin
|
|
|
| |
|
|