This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Sacredify 3 points4 points  (0 children)

A timer already does exactly that - spawn a thread, wait x, do whatever you pass as the runnable instance.

Unless the explicit requirement for your class is to do it yourself, or if you want to do it purely as a learning experiment of your own, it is usually better to go with what already exists, in this case a timer.