Sha256: 6d2199a0073b39e8139c30f13a991da6c09790b88915a95f51c7ce9ddafdda71
Contents?: true
Size: 1.24 KB
Versions: 28
Compression:
Stored size: 1.24 KB
Contents
== Description Sys::CPU - An interface for various cpu statistics == Synopsis require "sys/cpu" include Sys CPU.processors{ |cs| cs.members.each{ |m| puts "#{m}: " + cs[m].to_s } } CPU.bogomips(1) # -> returns bogomips for cpu #2 == Notes Portions of this documentation built dynamically == Constants VERSION Returns the current version number for this package as a String. == Class Methods CPU.load_avg Returns an array of three floats indicating the 1, 5 and 15 minute load average. CPU.cpu_stats Returns a hash, with the cpu number as the key and an array as the value. The array contains the number of seconds that the system spent in user mode, user mode with low priority (nice), system mode, and the idle task, respectively, for that cpu. CPU.processors{ |cpu struct| block } Calls the block for each processor on your system, passing a CPUStruct as the parameter. The exact members of the CPUStruct are the same as the class method names, except for CPU.processors (although you may optionally omit the "?" when referring to a struct member). These were determined when you installed this package because they vary from one chip architecture to another.
Version data entries
28 entries across 28 versions & 1 rubygems