How To Use Python Timeit (Simple Example)

Опубликовано: 16 Сентябрь 2022
на канале: Make That Work
100
3

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!


На этой странице сайта вы можете посмотреть видео онлайн How To Use Python Timeit (Simple Example) длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Make That Work 16 Сентябрь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 100 раз и оно понравилось 3 зрителям. Приятного просмотра!