File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- import concurrent .futures
21import time
2+ from concurrent .futures import ProcessPoolExecutor
33
44
55def main ():
66 start_time = time .perf_counter ()
7- with concurrent . futures . ProcessPoolExecutor () as executor :
7+ with ProcessPoolExecutor () as executor :
88 executor .map (fib , [35 ] * 20 )
99 duration = time .perf_counter () - start_time
1010 print (f"Computed in { duration } seconds" )
Original file line number Diff line number Diff line change 1- import concurrent .futures
21import time
2+ from concurrent .futures import ThreadPoolExecutor
33
44
55def main ():
66 start_time = time .perf_counter ()
7- with concurrent . futures . ThreadPoolExecutor (max_workers = 5 ) as executor :
7+ with ThreadPoolExecutor (max_workers = 5 ) as executor :
88 executor .map (fib , [35 ] * 20 )
99 duration = time .perf_counter () - start_time
1010 print (f"Computed in { duration } seconds" )
Original file line number Diff line number Diff line change 1- import concurrent .futures
21import threading
32import time
3+ from concurrent .futures import ThreadPoolExecutor
44
55import requests
66
@@ -19,7 +19,7 @@ def main():
1919
2020
2121def download_all_sites (sites ):
22- with concurrent . futures . ThreadPoolExecutor (max_workers = 5 ) as executor :
22+ with ThreadPoolExecutor (max_workers = 5 ) as executor :
2323 executor .map (download_site , sites )
2424
2525
You can’t perform that action at this time.
0 commit comments