JupyterLab 4.0.5: Adding execution time to cell
I’ve been using Jupyter Lab notebooks in some of my recent videos on Learn Data with Mark and I wanted to show cell execution timings so that viewers would have an idea of how long things were taking. I thought I’d need to use a custom timer, but it turns out there’s quite a nice plug-in, which we’ll learn about in this blog post.
The plug-in is called jupyterlab-execute-time
and it shows a live view of the time that a cell takes to execute, as well as showing the execution time afterward.
We can install the library directly using pip:
pip install jupyterlab_execute_time
Or Poetry, if that’s your thing:
poetry add jupyterlab_execute_time
Alternatively, we can use the extension manager inside Jupyter Lab, which you can launch by typing Cmd + Shift + X
on a Mac.
Once it pops up, search for jupyterlab-execute-time
, as shown below:
And then click on 'Install'.
Regardless of the installation option used, you should then see the plugin under the 'Installed' section:
And here’s a screenshot showing the timings for a few cells in a notebook that I’m currently working on:
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.