ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 27 Jul 2019 00:36:07 +0200Is there any way to have a cell tell you how long it took to run in the Jupyter notebook?https://ask.sagemath.org/question/47269/is-there-any-way-to-have-a-cell-tell-you-how-long-it-took-to-run-in-the-jupyter-notebook/ The question is basically all in the title. I'm working on a project in the Jupyter and notebook, and I have some cells that have longer run times. Sometimes I let these run, and come back to check on them later, however it would be nice to know exactly what duration those cells ran for.Fri, 26 Jul 2019 23:31:17 +0200https://ask.sagemath.org/question/47269/is-there-any-way-to-have-a-cell-tell-you-how-long-it-took-to-run-in-the-jupyter-notebook/Answer by John Palmieri for <p>The question is basically all in the title. I'm working on a project in the Jupyter and notebook, and I have some cells that have longer run times. Sometimes I let these run, and come back to check on them later, however it would be nice to know exactly what duration those cells ran for.</p>
https://ask.sagemath.org/question/47269/is-there-any-way-to-have-a-cell-tell-you-how-long-it-took-to-run-in-the-jupyter-notebook/?answer=47270#post-id-47270You can put `%%time` as a line at the start of the cell. Does that do what you want?
See also https://stackoverflow.com/questions/32565829/simple-way-to-measure-cell-execution-time-in-ipython-notebook and https://nbviewer.jupyter.org/github/ipython/ipython/blob/1.x/examples/notebooks/Cell%20Magics.ipynbSat, 27 Jul 2019 00:36:07 +0200https://ask.sagemath.org/question/47269/is-there-any-way-to-have-a-cell-tell-you-how-long-it-took-to-run-in-the-jupyter-notebook/?answer=47270#post-id-47270