记录分析python程序运行时间的几种方法


import datetime
import time
start = time.time()

time.sleep(2)  ### 你的代码

end = time.time()
mystr="run time: %d seconds" % ( end-start)
print(mystr)

posted @ 2021-01-27 09:10  emanlee  阅读(762)  评论(0编辑  收藏  举报