Added code to measure cost of various operations in Python