Difference between revisions of "Lua:getCPUCount"
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 | + | Returns the number of CPUs. |
| − | + | ===Function Parameters=== | |
| + | This function has no parameters. | ||
| − | == Examples == | + | ===Returns=== |
| − | < | + | integer — The number of CPUs. |
| − | getCPUCount() | + | |
| − | </ | + | ===Examples=== |
| + | <syntaxhighlight lang="lua" line> | ||
| + | local cpuCount = getCPUCount() | ||
| + | |||
| + | print("CPU count: " .. cpuCount) | ||
| + | </syntaxhighlight> | ||
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
| − | + | {{Threads}} | |
| − | |||
Latest revision as of 20:52, 26 June 2026
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)