java - Delay a for loop for a certain number of seconds -
i have loop this:
for (int = 0; < 10; i++) { //do //delay 5 seconds go next iteration of loop }
how specify delay in java?
the default way thread.sleep(5000). used in context of multithreading.
for (int = 0; < 10; i++) { //do //delay 5 seconds go next iteration of loop try { thread.sleep(5000); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } }
Comments
Post a Comment