Create this as a decorator.

import time
 
def measure_performance():
	start = time.time()
	print("Time consuming method here")
	end = time.time()
	print(end - start)