question: private int timeoutWait ( int currentTotalWaitTime , long poll , long maxTimeoutMillis , String timedOutMessage ) throws TimeoutException { long now = SystemClock . elapsedRealtime ( ) ; long end = now + poll ; while ( now < end ) { try { Thread . sleep ( end - now ) ; } catch ( InterruptedException e ) { } now = SystemClock . elapsedRealtime ( ) ; } currentTotalWaitTime += poll ; if ( currentTotalWaitTime > maxTimeoutMillis ) { throw new TimeoutException ( timedOutMessage ) ; } return currentTotalWaitTime ; }
target:  Helper function to synchronously wait, or timeout if the maximum threshold has been exceeded.