python 查看cpu的核数实现
作者:Rustone 时间:2023-01-02 21:09:31
如何查看cpu的核数
代码:
from multiprocessing import cpu_count
print("CPU的核数为:{}".format(cpu_count()))
print(type(cpu_count()))
结果:
CPU的核数为:4
<class 'int'>
查看cpu的核心数、线程数
方法一
进入系统的任务管理器:点击“性能”标签,找到CPU项,如下图所示:
注意:设备管理器中的处理器数量为线程数:
因为Intel的超线程技术存在,它把一个CPU内核虚拟化为类似2个CPU内核,所以看到了4个处理器,线程越多,能并行同时处理的任务数也越多。
方法二
下载CPU-Z 工具可以看到CPU的核心数和线程数,如下图所示:
来源:https://blog.csdn.net/m0_37360684/article/details/104048542
标签:python,cpu,核数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
搭建一个开源项目两种方式安装git的详细教程
2022-10-24 13:04:55
![](https://img.aspxhome.com/file/2023/0/132430_0s.png)
Python装饰器语法糖
2022-07-10 15:11:34
python实现对变位词的判断方法
2022-01-29 04:36:10
Spring Boot如何解决Mysql断连问题
2024-01-14 23:52:42
![](https://img.aspxhome.com/file/2023/1/97981_0s.png)
python中安装django模块的方法
2023-08-27 13:30:21
![](https://img.aspxhome.com/file/2023/1/65051_0s.png)
详解Golang利用反射reflect动态调用方法
2024-05-02 16:23:47
spring mvc4.1.6 spring4.1.6 hibernate4.3.11 mysql5.5.25开发环境搭建图文教程
2024-01-23 12:27:19
![](https://img.aspxhome.com/file/2023/4/68734_0s.jpg)
python如何查找图片按钮的坐标位置
2023-01-07 21:57:53
![](https://img.aspxhome.com/file/2023/6/117306_0s.jpg)
Python获取江苏疫情实时数据及爬虫分析
2022-09-19 02:12:30
![](https://img.aspxhome.com/file/2023/9/95439_0s.jpg)
php逐行读取txt文件写入数组的方法 <font color=red>原创</font>
2023-11-14 17:22:07
Asp与JS的数组和字符串下标介绍
2022-10-11 13:40:25
mysql中如何查看表空间
2024-01-27 00:25:25
![](https://img.aspxhome.com/file/2023/2/112312_0s.png)
python字符串替换re.sub()实例解析
2022-09-15 00:25:18
快速掌握ASP连接11种数据库的常用语法
2008-11-28 15:32:00
深入浅析Python 命令行模块 Click
2022-12-13 19:41:40
在Vue中配置代理服务器的方法详解
2024-04-30 10:22:10
![](https://img.aspxhome.com/file/2023/5/130255_0s.jpg)
Python调用Tkinter示例浅析
2022-04-30 02:53:32
![](https://img.aspxhome.com/file/2023/9/79599_0s.png)
Python多线程通信queue队列用法实例分析
2023-09-22 21:11:44
![](https://img.aspxhome.com/file/2023/4/93784_0s.png)
YUI3新特性学习
2012-04-26 16:25:20
mysql命令行爱好者必备工具mycli
2024-01-24 13:33:33
![](https://img.aspxhome.com/file/2023/1/114951_0s.gif)