在excel中创build一个定时器,在运行时显示十分之几秒的时间

我试图把一个计时器放入Excel中的一个macros。 我已经跟着一个教程,但是,计时器始终放在0秒的运行时间。 我知道我所写的东西的时间复杂性很小,但是我认为它仍然会在几十秒或十分之一秒左右。

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" 

StartTimeSecondsElapsed的数据types更改为DoubleLong不会持有分数值。