public static boolean sleep ( long milliseconds , int nanoseconds ) { try { Thread . sleep ( milliseconds , nanoseconds ) ; return true ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; return false ; } }
Causes the current Thread to sleep for the specified number of milliseconds and nanoseconds . If the current Thread is interrupted the sleep is aborted however the interrupt bit is reset and this method returns false .