Python Measure How Long A Function Takes