gevent

from gevent import monkey;monkey.patch_all()
import time
from gevent import spawn

def pp():
print('ppstar')
time.sleep(2)
print('ppover')
def oo():
print('oostart')
time.sleep(5)
print('ooover')
star_time=time.time()
p=spawn(pp)
o=spawn(oo)
o.join()
p.join()
print(time.time()-star_time)
上一篇:python——gevent


下一篇:Git报错 error: cannot spawn more: No such file or directory