import multiprocessing
import time

def worker(i):
    time.sleep(i)
return i
if __name__ == '__main__':
    pool = multiprocessing.Pool()
result = pool.map_async(worker, list(range(15)))
while not result.ready():
    print('num left: {}'.format(result._number_left))
time.sleep(1)
real_result = result.get()
pool.close()
pool.join()
Counting total number of tasks executed in a multiprocessing.Pool during execution