Difference between revisions of "Lua:getCPUCount"

From Cheat Engine
Jump to navigation Jump to search
m (Added related function template.)
 
Line 11: Line 11:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local cpuCount = getCPUCount()
 
local cpuCount = getCPUCount()
  
 
print("CPU count: " .. cpuCount)
 
print("CPU count: " .. cpuCount)
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
 +
 +
{{Threads}}

Latest revision as of 20:52, 26 June 2026

<> Lua API Reference

function getCPUCount() : integer

Returns the number of CPUs.

Function Parameters[edit]

This function has no parameters.

Returns[edit]

integer — The number of CPUs.

Examples[edit]

1 local cpuCount = getCPUCount()
2 
3 print("CPU count: " .. cpuCount)

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Thread Related Lua Functions

CPU information, process threads, main-thread execution, and queued callbacks