How long does my Python application take to run?

The simplest way to do it is to put:

import time
start_time = time.time()

at the start and

print "My program took", time.time() - start_time, "to run"

at the end.

Leave a Comment