1
我想把一個計時器放入excel中的宏。我遵循教程,但是,計時器始終將運行時間設置爲0秒。我知道我寫的東西的時間複雜度很小,但是我會認爲它仍然會在幾秒或十分之一秒左右。在excel中創建一個計時器,在運行時顯示十分之幾秒鐘hundreths
在這種情況下Excel是否舍入?
'For me to keep track of time complexity
Dim StartTime As Long
Dim SecondsElapsed As Long
StartTime = Timer
隨後代碼在子
'Timer runs to give lifespan of operation
SecondsElapsed = Round(Timer - StartTime, 2)
Cells(24, 4).Value = "This took " & SecondsElapsed & " seconds to run"