How to use the timeit module to check performance of your code
Motivation Sometimes you want to know how fast your code is. Before you start implementing a timer use the Python built-in timeit module. #measurewhatmatters Example Let’s take a simple function like a recursive implementation of factorial: def factorial(n): if n > 0: return n * factorial(n-1) else: return 1 If you want to test how…