I\'m trying to capture the resulting object of IPython Notebook magic function. Specifically %timeit
%timeit
So the following code...
import tim
An example of consuming the TimeItResult output:
myarray = (3,2,1) sorttime = %timeit -n1 -r3 -o myarray.sort() print(sorttime.best)
Look here for the other TimeItResult attributes: https://ipython.org/ipython-doc/2/api/generated/IPython.core.magics.execution.html