a python timer to record function execution time