Custom Search

Thursday, January 6, 2011

Python calculate time taken to execute a function

Python calculate time taken to execute(run) a code or function or script.

>>> now = time.time()

>>> content1 = Myclass().content()  <---- do some works

>>> time.time() - now
22.43316888809204  <-------time taken to do that works

No comments:

Post a Comment