Sleep in java

Option 1:

Thread.sleep(4000);

Option 2:

import java.util.concurrent.TimeUnit
 
TimeUnit.SECONDS.sleep(2);
Content Protection by DMCA.com
Please Share