Information about this Mac's hardware and how busy it is (CPU and memory usage, load
average, swap and memory pressure), and whether it is in light or dark mode.
Every reading is a single cheap system call, so to monitor something over time, read it from
an hs.timer. The exception is CPU usage, which macOS only reports as running totals: a
percentage needs two readings some time apart, so cpuUsage() and cpuCoreUsage() return
Promises that resolve after the interval you choose.
Information about this Mac's hardware and how busy it is (CPU and memory usage, load average, swap and memory pressure), and whether it is in light or dark mode.
Every reading is a single cheap system call, so to monitor something over time, read it from an
hs.timer. The exception is CPU usage, which macOS only reports as running totals: a percentage needs two readings some time apart, socpuUsage()andcpuCoreUsage()return Promises that resolve after the interval you choose.