python 计时程序运行时间

import time

time_start=time.time()
time_end=time.time()
print('totally cost',time_end-time_start)