Module: CPU::Shared

Included in:
Load, Processor, Usage
Defined in:
lib/cpu/shared.rb

Instance Attribute Summary collapse

Instance Attribute Details

#num_coresObject

Returns the number of cores in this computer



17
18
19
20
21
22
23
# File 'lib/cpu/shared.rb', line 17

def num_cores
  if defined?(@num_cores)
    @num_cores
  else
    CPU.num_cores
  end
end

#num_processorsObject

Returns the number of processors in this computer



4
5
6
7
8
9
10
# File 'lib/cpu/shared.rb', line 4

def num_processors
  if defined?(@num_processors)
    @num_processors
  else
    CPU.num_processors
  end
end