system
luau
local system = require("@lute/system")WARNING
These APIs are still open to future evolution. In new major versions, they may change in backwards incompatible ways.
Summary
| Entry | Description |
|---|---|
| CpuInfo | CPU information for a single logical processor, including model, speed, and time-usage breakdown. |
| arch | The CPU architecture of the current machine, e.g. "x64", "arm64". |
| cpus | Returns CPU information for each logical processor on the current machine. |
| freeMemory | Returns the amount of free (available) system memory in bytes. |
| hostName | Returns the hostname of the current machine. |
| os | The current operating system, e.g. "linux", "macos", "windows". |
| threadCount | Returns the number of logical CPU threads available on the current machine. |
| tmpdir | Returns the path to the system's temporary directory. |
| totalMemory | Returns the total amount of system memory in bytes. |
| uptime | Returns the system uptime in seconds. |
Types
CpuInfo
CPU information for a single logical processor, including model, speed, and time-usage breakdown.
luau
type CpuInfo = {
model: string,
speed: number,
times: {
sys: number,
idle: number,
irq: number,
nice: number,
user: number,
},
}Functions and Properties
system.arch
The CPU architecture of the current machine, e.g. "x64", "arm64".
luau
stringsystem.cpus
Returns CPU information for each logical processor on the current machine.
luau
() -> { CpuInfo }system.freeMemory
Returns the amount of free (available) system memory in bytes.
luau
() -> numbersystem.hostName
Returns the hostname of the current machine.
luau
() -> stringsystem.os
The current operating system, e.g. "linux", "macos", "windows".
luau
stringsystem.threadCount
Returns the number of logical CPU threads available on the current machine.
luau
() -> numbersystem.tmpdir
Returns the path to the system's temporary directory.
luau
() -> stringsystem.totalMemory
Returns the total amount of system memory in bytes.
luau
() -> numbersystem.uptime
Returns the system uptime in seconds.
luau
() -> number