import time time_start = time.time() # func() time_end = time.time() time_cost2 = (time_end - time_start) * 1000 print(str(time_cost2)+ "ms\n")