Dec 11, 2017

Java threads can be put to sleep for a certain duration

 This is quite handy to simulate long running tasks.

TimeUnit is a useful enum for working with units of time. 

TimeUnit.SECONDS.sleep(1);

Alternatively you can achieve the same by calling Thread.sleep(1000).