Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Sunday, August 7, 2011

Measuring Python code execution time

import time

timestart = time.time()
# code to measure here
print time.time() - timestart, "seconds"

You can also try time.clock(). It is said to be more accurate.