lib/cpu.rb in cpu-0.0.4 vs lib/cpu.rb in cpu-0.0.6
- old
+ new
@@ -118,11 +118,11 @@
# Return a single Processor instance, measure CPU usage during the next
# +interval+ seconds or during the runtime of the given block, and then
# sum up the CPU usage in this instance.
def sum_usage_processor(interval = 1, &block)
processors = usage(interval, &block)
- processor = Processor.new -1, -1
+ processor = Processor.new(-1, -1)
processor.num_processors = processor.num_cores = 1
begin
processor.temperature = processors.map(&:temperature).max
rescue NoSampleDataError
processor.temperature = nil
@@ -132,5 +132,6 @@
processor.freeze
processor
end
end
end
+CPU::MSR.load_module