from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor
import time

def task(i):
    print(i)
    time.sleep(1)

pool = ThreadPoolExecutor(10)
for index in range(66):
    pool.submit(task,index)

print('end')

 

相关文章:

  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2021-07-07
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2022-02-14
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-01-23
  • 2021-11-13
相关资源
相似解决方案