Fix %timeit for slow functions, by Prabhu Ramachandran.
Fix %timeit for slow functions, by Prabhu Ramachandran.

From his submission on the list:

Lets say you have a function that takes 2 seconds to evaluate.  With the
original code you are going to run that function 10 times regardless of the
fact that it already takes 2 seconds and with the original code, timing this
will take at least 60 seconds (with repeat=3) which is way too much.

ipython/ipython,ipython/ipython