def benchmark(): gevent.spawn(printstats) for _ in xrange(1000): pool.spawn(bench, itemid) pool.join()