While Loop and Timer Advice

You may refer to this forum.

It has the code for it.