Bill McCarthy wrote:
I'd guess that in a tight loop it would probably be slightly faster to reset
the counter rather than continually get the modulus, eg:

counter+=1
....
If (counter And &H2000) = &H2000 Then ' every 8192
   counter = 0
End If

By resetting you also don't need to worry about integer overflows etc.

+1 this way.

For 100,000....

If (counter And &H186A0) = &H186A0 Then
' every 100,000
  counter = 0
End If

Reply via email to