Detect number of CPUs installed

前端 未结 12 944
孤城傲影
孤城傲影 2020-12-24 05:29

I already found a solution for \"Most unixes\" via cat /proc/cpuinfo, but a pure-Ruby solution would be nicer.

12条回答
  •  梦谈多话
    2020-12-24 06:04

    I tried using Facter but found it a bit slow. I tried system gem and found it a lot faster. It is also very easy to use: System::CPU.count.

提交回复
热议问题