import concurrent.futures
import time

start = time.perf_counter()

def do_something(seconds):
    print(f'Start sleeping {seconds} ')
    time.sleep(seconds)
    return f'done sleeping for {seconds}'

with concurrent.futures.ThreadPoolExecutor() as executor:
    secs = [5,4,3,2,1]
#    results = [executor.submit(do_something,sec) for sec in secs]
    results = executor.map(do_something,secs)
    
#    for f in concurrent.futures.as_completed(results):
#        print(f.result())


    for result in results:
        print(result)



ended = time.perf_counter()


print(f' Duration {round(ended - start,2)} s')