Difference between revisions of "Lua:getCPUCount"

From Cheat Engine
Jump to navigation Jump to search
(Created page with 'Category:Lua '''function''' getCPUCount() Returns the number of CPU's. {{LuaFunctionParametersNone}} == Examples == <pre> getCPUCount() </pre> {{LuaSeeAlso}} === Related…')
 
m (Added related function template.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' getCPUCount()
+
{{CodeBox|'''function''' getCPUCount() ''':''' integer}}
  
Returns the number of CPU's.
+
Returns the number of CPUs.
  
{{LuaFunctionParametersNone}}
+
===Function Parameters===
 +
This function has no parameters.
  
== Examples ==
+
===Returns===
<pre>
+
integer — The number of CPUs.
getCPUCount()
+
 
</pre>
+
===Examples===
 +
<syntaxhighlight lang="lua" line>
 +
local cpuCount = getCPUCount()
 +
 
 +
print("CPU count: " .. cpuCount)
 +
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
=== Related Functions ===
+
{{Threads}}
* [[Lua:getThreadlist|getThreadlist]]
 

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