Measuring_time

mail@pastecode.io avatar
unknown
python
3 years ago
226 B
3
Indexable
import time

def sum_up_to(end):
    sum = 0

    for number in range(1, end + 1):
            sum = sum + number

    return sum

start = time.perf_counter()
print(sum_up_to(125555))
end = time.perf_counter()
print(end-start)