#几核

linux 下查看机器是cpu是几核的

几个cpumore/proc/cpuinfo|grep"physicalid"|uniq|wc-l每个cpu是几核(假设cpu配置相同)more/proc/cpuinfo|grep"physicalid"|grep"0"|wc-lcat/proc/cpuinfo|grepprocessor1.查看物理CPU的个数#ca...

cpu几核

importpsutildefGetCpuInfo():cpu_count=psutil.cpu_count(logical=False)#1代表单核CPU,2代表双核CPUxc_count=psutil.cpu_count()#线程数,如双核四线程cpu_slv=round((psutil.cpu_percent(1...
代码星球 ·2020-04-10