Message403723
import concurrent.futures
import time
start = time.perf_counter()
def do_something(seconds):
print(f'sleeping for {seconds}s ... ')
time.sleep(seconds)
return f'done sleeping {seconds} '
with concurrent.futures.ThreadPoolExecutor() as executor:
secs = [5,4,3,2,1]
results = executor.map(do_something, secs)
for result in results:
print(result)
finish = time.perf_counter()
print(f'finished in {round(finish-start, 2)} seconds')
The above code yields an attribute error whereas it used to execute perfectly before. Did the method get removed? |
|
Date |
User |
Action |
Args |
2021-10-12 10:48:59 | zohim | set | recipients:
+ zohim |
2021-10-12 10:48:59 | zohim | set | messageid: <1634035739.42.0.184025452389.issue45443@roundup.psfhosted.org> |
2021-10-12 10:48:59 | zohim | link | issue45443 messages |
2021-10-12 10:48:59 | zohim | create | |
|