()
| 32 | ] |
| 33 | |
| 34 | def main(): |
| 35 | start = time.perf_counter() |
| 36 | pool = ProcessPoolExecutor(max_workers=8) # The one change |
| 37 | results = list(pool.map(my_module.gcd, NUMBERS)) |
| 38 | end = time.perf_counter() |
| 39 | delta = end - start |
| 40 | print(f"Took {delta:.3f} seconds") |
| 41 | |
| 42 | if __name__ == "__main__": |
| 43 | main() |