Skip to content
Advertisement

Java Delay/Wait

How do I delay a while loop to 1 second intervals without slowing down the entire code / computer it’s running on to the one second delay (just the one little loop).

Advertisement

Answer

Thread.sleep(1000); // do nothing for 1000 miliseconds (1 second)
Advertisement