How to measure time execution of small code in Python ?

Question

How to measure time execution of small code in Python ?

Re: How to measure time execution of small code in Python ?

Python provides a tool that answers solves that problem fast
Timer('a,b = b,a', 'a=1; b=2').timeit()