Question : java utils wait for seconds
Answered by : clear-curlew-7utd4jr6h0l8
try
{ Thread.sleep(1000);
}
catch(InterruptedException ex)
{ Thread.currentThread().interrupt();
}
Source : https://stackoverflow.com/questions/23283041/how-to-make-java-delay-for-a-few-seconds/48403623 | Last Update : Wed, 25 Nov 20
Question : java delay
Answered by : murali-s
Syntax :
========================================================= Thread.sleep(1000); // 1000 milliseconds.. |
=========================================================
int i=0;
for(;;){ Thread.sleep(2000); // set time delay to 2 seconds.. System.out.println(i++); // output : every output will display after 2 seconds..
}
Source : | Last Update : Tue, 26 May 20