Get the number of processor cores/threads.
1 2 3 4 5 6 |
var cpuCount: integer; begin cpuCount:= getLogicalCPUCount(); ShowMessage(IntToStr(cpuCount)); end; |
Options
No
Result
The number of processor cores/threads, or (-1) on failure.
1 2 3 4 5 6 7 8 9 10 11 |
function getLogicalCPUCount: integer; var s: TSystemInfo; begin try GetSystemInfo(s); Result := s.dwNumberOfProcessors; except Result:= -1; end; end; |