Python Find Time Taken By A Function In Math