title: %timeit equivalent in code
body: <p>The magic command <code>%timeit</code> is great to measure code execution times in an interactive way. However, I want to get the result of <code>%timeit</code> in order to plot the results. <code>timeit.timeit</code> allows this as well, but does not have the automatic scaling of the number of iterations and the normalising of the result that <code>%timeit</code> has.</p>
  
  <p>Is there a built in function that can time a piece of code, which also automatically adjusts the number of iterations it performs, and returns a normalised result?</p>