How to measure python execution time using the Timeit module

preview_player
Показать описание
In this quick tutorial, I display how to practically use the built in Python Timeit module to test the execution time of snippets of code.

This can be very useful when for example you want to measure how quickly a JSON serialization library can serialize a test response.
Рекомендации по теме
Комментарии
Автор

Thank you for your explanation of this!

maty
Автор

u god, with the lambda addition I could use the timeit. Thanks.

RafaQuin
Автор

it slows down the execution time by a factor of like 100. any idea why?

henrikasvaranauskas
Автор

Thanks this worked for me. Why does it only work when I put lambda in front of the function i'm testing? Otherwise I get an error.

vanslyf