Comprobación velocidad

Run Settings
LanguagePython
Language Version
Run Command
from time import time lista_total = [] listado_nuevo = [] listado_no_existen = [] listado_existen = [] na = 222222 for i in range(4000): listado_nuevo.append(na) na = na + 1 nb = 100 for i in range(4000): listado_nuevo.append(nb) nb = nb + 1 for i in range(90000): lista_total.append(i) tiempo_inicial1 = time() for i in listado_nuevo: if i not in lista_total: listado_no_existen.append(i) tiempo_final1 = time() tiempo_ejecucion1 = tiempo_final1 - tiempo_inicial1 print("Tiempo de ejecucion1 :" , tiempo_ejecucion1) print(listado_no_existen) conjunto_total = set(lista_total) conjunto_nuevo = set(listado_nuevo) tiempo_inicial2 = time() conjunto_existen = conjunto_nuevo - conjunto_total tiempo_final2 = time() tiempo_ejecucion2 = tiempo_final2 - tiempo_inicial2 print(conjunto_existen) print("Tiempo de ejecucion2 :" , tiempo_ejecucion2)
Editor Settings
Theme
Key bindings
Full width
Lines