记录分析python程序运行时间的几种方法
import datetime
import time
start = time.time()
time.sleep(2) ### 你的代码
end = time.time()
mystr="run time: %d seconds" % ( end-start)
print(mystr)
import datetime
import time
start = time.time()
time.sleep(2) ### 你的代码
end = time.time()
mystr="run time: %d seconds" % ( end-start)
print(mystr)