Dim Sec,LastSec,LoopCount,LoopCount2, Speed, Counts_10ms
Speed=4 ' rotation speed 10ms*4 = 40ms
If SmartTags("AnimationByte")<>0 Then Exit Sub ' to prevent run sub multiple times
Do
LoopCount=LoopCount+1
Sec=Second(Now)
If Sec<>LastSec Then
LastSec=Sec
Counts_10ms=LoopCount/100
LoopCount=0
End If
LoopCount2=LoopCount2+1
If LoopCount2>=(Counts_10ms*Speed) Then
SmartTags("AnimationByte")=SmartTags("AnimationByte")+1
If SmartTags("AnimationByte")>10 Then SmartTags("AnimationByte")=1 End If
LoopCount2=0
End If
Loop