Welcome to the Forum! Please read this topic to learn how to post your code correctly along with other useful info for newcomers.

You should consider using a Timer to do what you have in mind, in...