Skip to content
Snippets Groups Projects
Select Git revision
  • 5dbc3e3559712103f0b87b641bfaebecec0e6cee
  • master default protected
2 results

tri-selection.py

Blame
  • Forked from Vuillemot Romain / INF-TC1
    Source project has a limited visibility.
    test_analyse.py 583 B
    #%%
    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")
    # %%