What I want is to start counting time somewhere in my code and then get the passed time, to measure the time it took to execute few function. 我想要的是開始在個人代碼中的某個地方開始計時,而後獲取通過的時間,以衡量執行少許功能所花費的時間。 I think I'm using the timeit module wrong, but the docs are just confusing for me. 我認爲我使用的timeit模塊錯誤,可是文檔對我來講卻很混亂。 spa
import timeit start = timeit.timeit() print("hello") end = timeit.timeit() print(end - start)