import time
import geventfrom gevent.threadpool import ThreadPoolpool = ThreadPool(6)start = time.time()for _ in range(12): pool.spawn(time.sleep, 1)gevent.wait()delay = time.time() - startprint('Running "time.sleep(1)" 4 times with 3 threads. Should take about 2 seconds: %.3fs' % delay)