-
-
Notifications
You must be signed in to change notification settings - Fork 6
Home
djberg96 edited this page Sep 27, 2011
·
15 revisions
The sys-cpu library provides an interface for gathering information about your system's CPU.
require 'sys/cpu' include Sys puts CPU.architecture # CPU architecture, e.g. "i386" puts CPU.freq # CPU frequency puts CPU.load_avg # Array containing load average for 1, 5 and 15 minute periods puts CPU.model # CPU model puts CPU.machine # CPU class. May be identical to architecture. puts CPU.num_cpu # Number of CPU's (cores)