Einzelnen Beitrag anzeigen

Basilikum

Registriert seit: 9. Aug 2003
389 Beiträge
 
Delphi 7 Professional
 
#10

Re: Durch eigenen Prozess verursachte CPU-Auslastung bekomme

  Alt 25. Mai 2005, 07:54
Zitat von Luckie:
1. Gibt der Code van Basilikum an wie viel CPU-Zeit der Prozess verbraucht und nicht die Auslastung in Prozent.
MSDN-Library durchsuchenGetProcessTimes
Zitat:
lpKernelTime
[out] Pointer to a FILETIME structure that receives the amount of time that the process has executed in kernel mode. The time that each of the threads of the process has executed in kernel mode is determined, and then all of those times are summed together to obtain this value.
lpUserTime
[out] Pointer to a FILETIME structure that receives the amount of time that the process has executed in user mode. The time that each of the threads of the process has executed in user mode is determined, and then all of those times are summed together to obtain this value.
1. stimmt nicht: GetProcessTimes liefert tatsächlich "nur" die verbratene CPU-Zeit... diese wird jedoch mit der Division durch die verstrichenen Ticks mit der "echten" Zeit in Relation gebracht, und ergibt so den prozentualen Anteil der Zeit, die der Process während der letzen Berechnungsperiode tatsächlich den CPU beansprucht hat... bei CPU-Zeit = verstrichene Ticks => 100%, bei CPU-Zeit = 0 => 0%
  Mit Zitat antworten Zitat