Timer difference in running the same code

yxz152830

Active Member
Joined
Oct 6, 2021
Messages
393
Office Version
  1. 365
Platform
  1. Windows
Gurus,
for below code, timer takes down 10 records but 2 records are 1 sec lower than the other 8. Is there any reason behind this or this is within the deviation range? Thank you.

VBA Code:
Sub pop()
For x = 1 To 10
st = Timer
d = Now + TimeValue("00:00:03")
For Each cell In Range(Cells(18, 1), Cells(18, 10))
Do
Loop Until d <= Now
d = Now + TimeValue("00:00:03")
cell.Interior.ColorIndex = 3
Next cell
st = Timer - st
Range("o100").End(xlUp).Offset(1, 0) = st
Range(Cells(18, 1), Cells(18, 10)).Clear
Next x
End Sub



timer
30.86328​
31.99609​
31.98828​
31.99609​
30.99609​
31.99609​
31.99609​
31.99609​
31.99609​
31.99609​
 
that is bull **** (apparently censored word), try in an empty sheet
Notwithstanding the fact that this tone is unnecessary and unacceptable, I can't really see what you are taking exception to. The post prior to your clearly states and demonstrates that Now = Now().
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
sorry, but perhaps i should have said, in a more polite way, that excel works with 15 numbers of precision.
So after multiplying such number with 86400 (seconds/day) the digits after the point such as .999999xxx (6 9's) and .0000000xxx (7 0's) are equal.

In the screenshot of Bebo02199, there are 5 digits before the point + 6 9's + almost 5 digits because of multiplying with 86400 = 15 !
that many digits after the point is a pure optical illuson without meaning.
Round(their value,6) gives the same value.
Better, more appropriate ?
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,860
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top