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!
In questa pagina del sito puoi guardare il video online How To Use Python Timeit (Simple Example) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Make That Work 16 settembre 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 100 volte e gli è piaciuto 3 spettatori. Buona visione!