public static TimeDuration pause(final long sleepTimeMS){
  final long startTime=System.currentTimeMillis();
  do {
    try {
      final long sleepTime=sleepTimeMS - (System.currentTimeMillis() - startTime);
      Thread.sleep(sleepTime > 0 ? sleepTime : 5);
    }
 catch (    InterruptedException e) {
    }
  }
 while ((System.currentTimeMillis() - startTime) < sleepTimeMS);
  return TimeDuration.fromCurrent(startTime);
}

public static TimeDuration pause ( final long sleepTimeMS ) { final long startTime = System . currentTimeMillis ( ) ; do { try { final long sleepTime = sleepTimeMS - ( System . currentTimeMillis ( ) - startTime ) ; Thread . sleep ( sleepTime > 0 ? sleepTime : 5 ) ; } catch ( InterruptedException e ) { } } while ( ( System . currentTimeMillis ( ) - startTime ) < sleepTimeMS ) ; return TimeDuration . fromCurrent ( startTime ) ; }
pause the calling thread the specified amount of time .
