Skip to content
djberg96 edited this page Sep 27, 2011 · 15 revisions

Description

The sys-cpu library provides an interface for gathering information about your system's CPU.

Synopsis

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)
Clone this wiki locally