sysinfo
Canonical Import
fennel
(local sysinfo (require :sysinfo))Source Files
src/lua_sysinfo.cppsrc/lua_runtime.cpp
What It Provides
sysinfo reports platform information, wall-clock timing helpers, system CPU and memory usage, and process information.
API Summary
platform()returnsos,arch, optionallua, andfeatures.system()returns a system handle.sleep(seconds)sleeps the current thread for positive durations.now-ms()returns steady-clock milliseconds.- System methods include
refresh,cpu-usage,cpu-times,mem-virtual,process-current,process(pid), andprocess-list([opts]). - Process methods include
pid,exists,name,refresh,cpu,cpu-times, andmem.
Examples
fennel
(local sysinfo (require :sysinfo))
(local system (sysinfo.system))
(system:refresh)
(sysinfo.sleep 0.05)
(local cpu (system:cpu-usage))
(print (sysinfo.platform).os cpu.percent)Errors and Platform Notes
Many metric methods return empty or warmup tables when OS data is unavailable or a baseline is not ready. Process and per-core capabilities vary by Linux, Windows, and macOS and are advertised through platform().features.
Related Modules
Aliases and Search Terms
Search terms: system info, CPU, memory, process list, platform, sleep, time.
