'Automatic cell execution timing in jupyter lab

In jupyter notebook, I can configure an automatic cell timing with nbextensions, the result is like so:

jupyter_notebook

How can I do this in jupyter lab? I didn't find any extensions that do a similar thing.

Obs.: I know that a similar result can be achieved with %%time magic, but I want it to be automatic, so I don't have to place the magic function at the beginning of each cell.



Solution 1:[1]

Requirement

JupyterLab >= 2.0.2

enter image description here

Let's move step by step

Extension availabel in jupyter lab is

jupyterlab-execute-time

first enable extension Manager

enter image description here

after enable you see new button in side task bar at the end "extension Manager"

You can also enable it with the following steps:

  1. Go into advanced settings editor.
  2. Open the Extension Manager section.
  3. Add the entry “enabled”: true.
  4. Save the settings. If prompted whether you are sure, read the warning, and click “Enable” if you are still sure. Once enabled, you should see a new tab appear in the left sidebar enter image description here

By default, the disclaimer is not acknowledged. enter image description here

As the disclaimer is not acknowledged, you can search for an extension, but can not install it (no install button is available). enter image description here

To install an extensino, you first have to explicitly acknowledge the disclaimer. Once done, this will remain across sessions and the user does not have to check it again.

enter image description here

Finding Extension

enter image description here

search jupyterlab-execute-time

Install Enable

After enable you have to Rebuild it: A small popup window open on it click on Rebulid;

then you have to restart kernel

Still you find you will not able to see what you want :

Last thing

Note: for this to show anything, you need to enable cell timing in the notebook via Settings->Advanced Settings Editor->Notebook: {"recordTiming": true}

advance setting editor

enter image description here

finally "recordTiming"=true

enter image description here

and save it at right end!

Solution 2:[2]

Appreciated the answer of @welcome_back, but you don't have to mess with the jupyter extension manager especially if you are concerned about that warnings.

Enable execution time in 3 steps

  • install this package !pip install jupyterlab_execute_time
  • reload the jupyterlab page (no need to shut down)
  • go to notebook section in jupyterlab advanced setting and paste this code
{"recordTiming": true}
And voila!! you are done! ?

Solution 3:[3]

No need for an extension.

Simply use (at any cell):

try:
    %load_ext autotime
except:
    !pip install ipython-autotime
    %load_ext autotime

To stop cell timing, use:

%unload_ext autotime

Solution 4:[4]

When trying to install for jypyter lab >= 3.0.0 use:

pip install jupyterlab_execute_time

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cody Gray
Solution 2 tozCSS
Solution 3 Zvi
Solution 4 LucyDrops