Commit 0f8fece3 authored by Michael Krause's avatar Michael Krause 🎉
Browse files

Output number of threads in use

parent e34f878e
Pipeline #5791 passed with stage
in 48 seconds
......@@ -52,7 +52,7 @@ def burn(hours, threads):
c = 10**(1 - 36*log10(1.618))
n = log10(hours*3600/c)/log10(1.618)
n = int(floor(n))
print("Burning {} hours by stupidly calculating fib({}).".format(hours, n))
print("Burning {} hours by stupidly calculating fib({}), using {} thread(s)".format(hours, n, threads))
with ProcessPoolExecutor(max_workers=threads) as pool:
futures = {pool.submit(fib, n) for i in range(threads)}
for index, future in enumerate(as_completed(futures)):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment