I have a scenario where i want a thread to sleep for specific amount of time.
Code:
public void run(){ try{ //do something
I use it this way:
So it is not necessary to wait the specific time to end.
public void run(){ try { //do something try{Thread.sleep(3000);}catch(Exception e){} //do something }catch(Exception e){} }