diff --git a/bindings/ruby/examples/cpu_info.rb b/bindings/ruby/examples/cpu_info.rb new file mode 100644 index 00000000..f68a5a80 --- /dev/null +++ b/bindings/ruby/examples/cpu_info.rb @@ -0,0 +1,16 @@ +require 'rbsigar' + +sigar = Sigar.new + +infos = sigar.cpu_info_list + +num = infos.length + +puts num.to_s + " total CPUs.." + +infos.each do |info| + puts "Vendor........" + info.vendor + puts "Model........." + info.model + puts "Mhz..........." + info.mhz.to_s + puts "Cache size...." + info.cache_size.to_s +end