import time from multiprocessing import Process,Pool def f1(n): time.sleep(1) # print(n) return n*n if __name__ == '__main__': pool = Pool(4) for i in range(10): print('xxxxxx') res = pool.apply(f1,args=(i,)) print(res)