import threading
from datetime import datetime
def thread_func():
print("我是一个函数",datetime.now())
#将之分为20个线程为一组
def thread_func_20():
for i in range(20):
thread_func()
#500个线程分为25组20个
def many_thread():
for i in range(25):
t = threading.Thread(target=thread_func_20())
t.start()
if __name__ == '__main__':
start = datetime.today().now()
many_thread()
end = datetime.today().now() - start
print(end)
线程并发_分隔
最新推荐文章于 2024-08-31 21:39:38 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)