title: Python - Overcome import in timeit
body: <p>I recently noticed the following about the <code>timeit</code> python module:</p>
  
  <p>On my machine the lines:</p>
  
  <pre><code>from timeit import Timer
  t = Timer(stmt='a = 2**3**4')
  print("This took {:.3f}s to execute.".format(t.timeit()))
  </code></pre>
  
  <p>will produce:</p>
  
  <blockquote>
    <p>This took 0.017s to execute.</p>
  </blockquote>
  
  <p>On the other hand writing a file <strong>test.py</strong>:</p>
  
  <pre><code>#!/usr/bin/env python3
  
  a = 2**3**4
  </code></pre>
  
  <p>and calling:</p>
  
  <pre><code>from timeit import Timer
  t = Timer(stmt='import test')
  print("This took {:.3f}s to execute.".format(t.timeit()))
  </code></pre>
  
  <p>will produce:</p>
  
  <blockquote>
    <p>This took 0.126s to execute.</p>
  </blockquote>
  
  <p>And I'm wondering how I can test the execution time of <code>test.py</code> without changing the file itself. How can I work around importing the file (and therefore loosing time). </p>