I have a Thread that needs to continuously run, however when a certain action is called, I want to wait 500ms, and then do another action, without interrupting the main Thread. Is there any way to do so?
I immediately thought of creating an just restarting a new Thread each time, but this doesn't seem to work.
EDIT: There seems to be a confusion with the question, so let me elaborate. I have a thread that is contiously working. When and action is preformed, a method is called. In that method I need to wait for 500ms and then call another method, without interrupting the main thread. This also has to be re-usable.