perf_counter
Anonymous
plain_text
06/09/2022 11:44 PM
344 B
21
Indexable
##Measuring performance of code
import time
def sum_up_to(n):
sum = 0
for number in range(1, n + 1):
sum = sum + number
return sum
start = time.perf_counter()
print(sum_up_to(125555))
end = time.perf_counter()
print(end-start)
Editor is loading...