python查看一段程序的运行时长

from time import time

start = time()
print("Start: "+ str(start))
# 需要计时的程序
stop = time()
print("Stop: "+ str(stop))
total_time=str(stop-start)
print(total_time +"秒")

发布了197 篇原创文章 · 获赞 35 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/PoGeN1/article/details/103660963