code: public void sleep(Deadline deadline)
  	{
  		final long millis = Math.min(deadline.getTimeLeft(), getMilliseconds());
  
  		if (millis > 0)
  		{
  			try
  			{
  				Thread.sleep(millis);
  			}
  			catch (InterruptedException e)
  			{
  				// ignore but return
  			}
  		}
  	}
docs: Sleep for the duration of this timeout (or until the thread is interrupted, or until the provided deadline expires)