Profiling Python
def main():
   print "Hello, World"
import profile
profile.run('main()') #can also sort by time,
                      # ncalls, etc.
Hello, World
   3 function calls in 0.050 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall function
     1   0.000   0.000   0.000   0.000  main()
     1   0.000   0.000   0.000   0.000  ?
     1   0.500   0.500   0.500   0.500  profile
3