diff options
| author | ruki <[email protected]> | 2022-07-29 00:52:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-29 00:52:33 +0800 |
| commit | f588982a9b0d5bfedd23531e9e72724a2149a610 (patch) | |
| tree | 9c3acc0bfc1aaa579dbcf03cece01f808e0ef3a3 /tests | |
| parent | 50af6707efc8f4831d790005cdddad4278f3a37d (diff) | |
cache cpuinfo
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modules/os/cpuinfo.lua | 2 | ||||
| -rw-r--r-- | tests/modules/os/meminfo.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/modules/os/cpuinfo.lua b/tests/modules/os/cpuinfo.lua index 1f0180739..dfb04350c 100644 --- a/tests/modules/os/cpuinfo.lua +++ b/tests/modules/os/cpuinfo.lua @@ -1,7 +1,7 @@ function main() print(os.cpuinfo()) while true do - print(os.time(), os.cpuinfo("usagerate")) + print("total: %d%%", math.floor(os.cpuinfo("usagerate") * 100)) os.sleep(1000) end end diff --git a/tests/modules/os/meminfo.lua b/tests/modules/os/meminfo.lua index 68a245cda..e42d4350f 100644 --- a/tests/modules/os/meminfo.lua +++ b/tests/modules/os/meminfo.lua @@ -1,6 +1,6 @@ function main() while true do - print(os.time(), os.meminfo()) + print("%d%%", math.floor(os.meminfo("usagerate") * 100)) os.sleep(1000) end end |
