Python執行時間的計算方法

# CPU的執行時間
start = time.clock()
#
end = time.clock()
print(end-start)io

 

# 程序執行時間:
start = datetime.datetime.now()date

#
end = datetime.datetime.now()
print(end-begin)程序

 

程序執行時間=cpu時間 + io時間 + 休眠或者等待時間im

相關文章
相關標籤/搜索