I need to run an infinite loop until the user tells it to break. For example...
while(true)
{
someFunction();
Thread.sleep(4000);
}
As you can see I want to continuously run the function every 4 seconds. But how do I get out of the loop when I want it to stop?
Thanks in advance!