mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-10 21:58:48 +01:00
- Note: process_time gives CPU time used and perf_counter is absolute time used. - Looks to have noise of about 1-2%.
12 lines
239 B
Python
12 lines
239 B
Python
from __future__ import print_function
|
|
|
|
import time
|
|
|
|
def fib(n):
|
|
if n < 2: return n
|
|
return fib(n - 1) + fib(n - 2)
|
|
|
|
start = time.process_time()
|
|
for i in range(0, 5):
|
|
print(fib(28))
|
|
print("elapsed: " + str(time.process_time() - start)) |