多线程

import threading
import time
#进程是多个资源的集合
#线程是进程里面具体干活的
#线程和线程之间是互相独立的
start_time = time.time()
def down_load():
time.sleep(5)
print("运行完了")
for i in range(10):
t = threading.Thread(target=down_load)
t.start()
#t.join()#等的是最后一个线程
while threading.activeCount()!=1:
pass

print(threading.activeCount())#查看当前线程数
print(threading.current_thread())#查看当前线程

end_time = time.time()
print(end_time - start_time)
原文地址:https://www.cnblogs.com/lapt/p/11893245.html