Skip to content

Commit

Permalink
Final QA (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
gahjelle authored Nov 12, 2024
1 parent 214480e commit 9e6a15e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python-concurrency/cpu_processes.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import concurrent.futures
import time
from concurrent.futures import ProcessPoolExecutor


def main():
start_time = time.perf_counter()
with concurrent.futures.ProcessPoolExecutor() as executor:
with ProcessPoolExecutor() as executor:
executor.map(fib, [35] * 20)
duration = time.perf_counter() - start_time
print(f"Computed in {duration} seconds")
Expand Down
4 changes: 2 additions & 2 deletions python-concurrency/cpu_threads.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import concurrent.futures
import time
from concurrent.futures import ThreadPoolExecutor


def main():
start_time = time.perf_counter()
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
with ThreadPoolExecutor(max_workers=5) as executor:
executor.map(fib, [35] * 20)
duration = time.perf_counter() - start_time
print(f"Computed in {duration} seconds")
Expand Down
4 changes: 2 additions & 2 deletions python-concurrency/io_threads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import concurrent.futures
import threading
import time
from concurrent.futures import ThreadPoolExecutor

import requests

Expand All @@ -19,7 +19,7 @@ def main():


def download_all_sites(sites):
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
with ThreadPoolExecutor(max_workers=5) as executor:
executor.map(download_site, sites)


Expand Down

0 comments on commit 9e6a15e

Please sign in to comment.