The sleep () method is used to pause the execution of the current thread for a specific duration of the time.
Thread.sleep(2000);