%%time

Hi,

In Exercise M2.01, when importing the “validation_curve” code, I do not need “%%time“ :

but in the Notebook about the sample size in cross-validation, this “%%time“ code was used:

what does “%%time” mean and when should I used it?

Thank you in advance for your answer.

Claudine

%%time is a magic command. It’s a part of IPython.

%%time prints the wall time for the entire cell whereas %time gives you the time for first line only

Using %%time or %time prints 2 values:

  1. CPU Times
  2. Wall Time

You can read more about it in the documentation.