from multiprocessing import Pool
import time
import math
def sleep_function(x):
return math.atan(x)+math.pi/2
def worker(x):
time.sleep(sleep_function(x))
print(x)
def tantime_sort(l):
with Pool(len(l)) as p:
p.map(worker, l)
TEST_CASE = [3, 21, 1000, 17, 69, -2, 1.0, 10000, 0.1]
tantime_sort(TEST_CASE)