title: Python timeit problem
body: <p>I'm trying to use the timeit module but I don't know how.
  I have a main:</p>
  
  <pre><code>from Foo import Foo
  if __name__ == '__main__':
  ...
     foo = Foo(arg1, arg2) 
     t = Timer("foo.runAlgorithm()")
     print t.timeit(2)
  </code></pre>
  
  <p>and my Class Foo has a method named as runAlgorithm()</p>
  
  <p>the error is this: </p>
  
  <blockquote>
    <p>NameError: global name 'foo' is not defined</p>
  </blockquote>
  
  <p>What am I doing wrong?
  Can I take the time from a class method?</p>