#%% import time import random import matplotlib.pyplot as plt import numpy as np #%matplotlib inline nvalues = [100, 500, 1000, 1500, 2000, 2500, 3000] timesEtudiants1 = [] for i in nvalues: random.seed() p = 12**2 # Ordre de grandeur des valeurs liste = [] for x in range(i): liste.append(random.randint(0, p)) a=time.perf_counter() e1 = [] for n in liste: e1.append(n) b=time.perf_counter() timesEtudiants1.append(b-a) plt.plot(nvalues,timesEtudiants1, "r-", label="Etudiants 1") plt.title("Comparaison des performances") # %%