I am trying to do something in Java and I need something to wait / delay for an amount of seconds in a while loop.
while (true) { if (i == 3) { i
Use Thread.sleep(1000);
Thread.sleep(1000)
1000 is the number of milliseconds that the program will pause.
1000
try { Thread.sleep(1000); } catch(InterruptedException ex) { Thread.currentThread().interrupt(); }