The "ipythonic" way of timing code is using the %timeit or %%timeit magic function (respectively for online, and multi-line code).
These functions provide quite accurate results by running the code multiple times (the exact number is adaptive if not specified).
The global flag you are asking does not exist in ipython. Furthermore, just adding %%timeit
to all the cells will not work because global variables are not modified when calling %%timeit
. This "feature" is directly inherited from the timeit
module.
For more info see this ipython issue.