title: Python time measure function
body: <p>I want to create a python function to test the time spent in each function and print its name with its time, how i can print the function name and if there is another way to do so please tell me</p>
  
  <pre><code>def measureTime(a):
      start = time.clock() 
      a()
      elapsed = time.clock()
      elapsed = elapsed - start
      print "Time spent in (function name) is: ", elapsed
  </code></pre>