Thread has a static function sleep which allows you to put the current thread to sleep for a specified duration. It takes the number of milliseconds to sleep as the parameter:



try{
...