想要統計Python 運行的時間,發現實現起來非常簡單,不需要下載額外包,系統自帶。
import datetime
startTime = datetime.datetime.now()
# 中間這裏是運行的代碼
endTime = datetime.datetime.now()
print("運行的時間是:%ss" % (endTime - startTime).seconds)
想要統計Python 運行的時間,發現實現起來非常簡單,不需要下載額外包,系統自帶。
import datetime
startTime = datetime.datetime.now()
# 中間這裏是運行的代碼
endTime = datetime.datetime.now()
print("運行的時間是:%ss" % (endTime - startTime).seconds)
繼續運行 ?* 回憶上次內容 上次使用shell環境中的命令 命令 作用 c