question: static void delay ( long millis ) throws InterruptedException { long nanos = millis * ( 1000 * 1000 ) ; final long wakeupTime = System . nanoTime ( ) + nanos ; do { if ( millis > 0L ) Thread . sleep ( millis ) ; else Thread . yield ( ) ; nanos = wakeupTime - System . nanoTime ( ) ; millis = nanos / ( 1000 * 1000 ) ; } while ( nanos >= 0L ) ; }
target:  Delays, via Thread.sleep, for the given millisecond delay, but if the sleep is shorter than specified, may re-sleep or yield until time elapses.  Ensures that the given time, as measured by System.nanoTime(), has elapsed.