thisoldman
Well-known Member
- Joined
- Jan 5, 2014
- Messages
- 1,075
I'm sure many of you are familiar with the MicroTimer function by Charles Williams. A copy can be found here: https://msdn.microsoft.com/en-us/vba/excel-vba/articles/excel-improving-calcuation-performance#measuring-calculation-time
I'm curious about why the setup for the function calls and calculation includes the line:
MicroTimer = 0
It seems to me that the line is unneeded. When I use the function, there seems to be no discernible difference in results when the line is included, commented out, or deleted. Could it be that setting the value consumes a few less computation cycles compared to when it is set by default?
I'm curious about why the setup for the function calls and calculation includes the line:
MicroTimer = 0
Rich (BB code):
[✂ --Snip-- ✂]
Function MicroTimer() As Double
'
' Returns seconds.
Dim cyTicks1 As Currency
Static cyFrequency As Currency
'
MicroTimer = 0 ' ← Why this line?
' Get frequency.
If cyFrequency = 0 Then getFrequency cyFrequency
[✂ --Snip-- ✂]
It seems to me that the line is unneeded. When I use the function, there seems to be no discernible difference in results when the line is included, commented out, or deleted. Could it be that setting the value consumes a few less computation cycles compared to when it is set by default?
Last edited: