New course! Every coder should learn Generative AI!
Try a free lesson0
How to make time delay in java.
2 Answers
+ 2
try {
Thread.sleep(milliseconds);
} catch (InterruptedException e) {
}
0
You can use Thread.sleep(time); /* time in milliseconds */
I think you need to surround it with a try/catch though.