System.Classes.TThread.GetCPUUsage
Delphi
class function GetCPUUsage(var PrevSystemTimes: TSystemTimes): Integer; static;
C++
static int __fastcall GetCPUUsage(TSystemTimes &PrevSystemTimes);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Classes.pas System.Classes.hpp |
System.Classes | TThread |
Description
Calculates the average time that the CPU is busy executing user code and kernel code.
GetCPUUsage uses the TSystemTimes specified in PrevSystemTimes
in order to acquire the current CPU load that the system is experiencing.
GetCPUUsage returns the calculation as a percentage in a range from 0 to 100.
Note: The TSystemTimes specified in PrevSystemTimes
is updated with the value of the current system time.