title: Using magic command %% timeit -n1 -r1 causes jupyter does not keep the value of local variables
body: <p>I just noticed to something very strange. When I use <code>%%timeit -n1 -r1</code> magic command, to measure the execution time of a block of code in Jupyter lab, python does not keep the value of local variables after the execution of the block!
  For instance, if I run a block of code containing the following codes:</p>
  
  <pre><code>for i in range(10):
     for j in range(10):
         d = i - j
  </code></pre>
  
  <p>and then run <code>print(d)</code> in another block, the jupyter will show me the value of d in the last iteration. 
  But if I run this block of code:</p>
  
  <pre><code>%%timeit -n1 -r1
  for in in range(10):
     for j in range(10):
         d = i - j
  </code></pre>
  
  <p>and then run <code>print(d)</code>, the juoyter shows me an error message:</p>
  
  <pre><code>NameError: name 'd' is not defined
  </code></pre>
  
  <p>What is the explanation behind this strange behaviour? </p>