In Python 3.4.1, I\'m trying to measure how long it takes for a function to run and complete then recording it. I\'m currently doing it this like so:
startti
For quick performance analyses I use the following two lines (plus imports):
import time import numpy as np t = time.time() # ... print np.round_(time.time() - t, 3), 'sec elapsed'
It's short, simple and all I usually need.
(In most cases I've imported numpy anyway. So thats no overhead for me.)
numpy