Python 脚本线程数量查看方法
可以使用 Python 内置的 'threading' 模块来查看当前开启的线程数。具体实现代码如下:
import threading
print('当前线程数:', threading.active_count())
'threading.active_count()' 函数可以返回当前线程数。
原文地址: https://www.cveoy.top/t/topic/oAR7 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
可以使用 Python 内置的 'threading' 模块来查看当前开启的线程数。具体实现代码如下:
import threading
print('当前线程数:', threading.active_count())
'threading.active_count()' 函数可以返回当前线程数。
原文地址: https://www.cveoy.top/t/topic/oAR7 著作权归作者所有。请勿转载和采集!