Teile 10 bis 12.

This commit is contained in:
2023-03-28 12:26:50 +02:00
parent 298151634d
commit f7a5db9f39
27 changed files with 6459 additions and 75 deletions

14
teil12/pools.py Normal file
View File

@@ -0,0 +1,14 @@
from multiprocessing import Pool
import time
def calculate_square(n):
return n*n
if __name__ == "__main__":
starttime = time.time()
pool = Pool()
pool.map(calculate_square, range(0, 5))
pool.close()
endtime = time.time()
print(f"Time taken {endtime-starttime} seconds")