From ba9136a43051e32d8d8f7390a608e2d6ded3b364 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 15 Sep 2007 14:40:32 +0000 Subject: [PATCH] cpu_info_list example --- bindings/ruby/examples/cpu_info.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 bindings/ruby/examples/cpu_info.rb 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