Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- def cpu_task(n):
- total = 0
- for i in range(n):
- total += i**2
- return total
- start = time.time()
- results = [cpu_task(10_000_000) for _ in range(4)]
- end = time.time()
- print(f"Execution Time: {end - start:.2f} seconds")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement