bench.py

Created by cent20

Created on January 06, 2023

287 Bytes


import time

def benchmark():
    start = time.monotonic()
    #Calculs intensifs
    n = 1000000
    sum = 0
    for i in range(n):
        sum += i
    print(sum)

    end = time.monotonic()
    elapsed = end - start
    print("Temps d'exécution :", elapsed)

benchmark()