Timing your code is a useful capability to have.
In this video we use timeit to measure the amount of time two functions take to execute.
The two functions are two ways of building up a list in Python: a for loop and a list comprehension. We can compare the execution time to see what is faster. Spoiler alert: the list comprehension function was faster!
Give it a go in your own code!
En esta página del sitio puede ver el video en línea How To Use Python Timeit (Simple Example) de Duración hora minuto segunda en buena calidad , que subió el usuario Make That Work 16 septiembre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 100 veces y le gustó 3 a los espectadores. Disfruta viendo!