1、当前时间
time_now=time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
2、耗时
time_start=time.perf_counter()
...
time_end=time.perf_counter()
time_cost=(time_start-time_end)*1000
print('time_cost={}'.format(time_cost))
1、当前时间
time_now=time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
2、耗时
time_start=time.perf_counter()
...
time_end=time.perf_counter()
time_cost=(time_start-time_end)*1000
print('time_cost={}'.format(time_cost))