Returns the absolute time represented as an offset of the current time.
Throws a SeleniumException if timeout is invalid.

@param timeout  the number of milliseconds from "now" whose absolute time
to return
972397
function getTimeoutTime(timeout) {
    var now = new Date().getTime();
    var timeoutLength = parseInt(timeout);

    if (isNaN(timeoutLength)) {
        throw new SeleniumError("Timeout is not a number: '" + timeout + "'");
    }

    return now + timeoutLength;
}
259671
@Override
  public int readTimeout(byte []buf, int offset, int length, long timeout)
    throws IOException
  {
    Socket s = _s;
      
    if (s == null) {
      return -1;
    }
    
    int oldTimeout = s.getSoTimeout();
    s.setSoTimeout((int) timeout);
    
    try {
      int result = read(buf, offset, length);
      
      if (result >= 0) {
        return result;
      }
      else if (_is == null || _is.available() < 0) {
        return -1;
      }
      else {
        return ReadStream.READ_TIMEOUT;
      }
    } finally {
      s.setSoTimeout(oldTimeout);
    }
  }
47422
public long waiting(long timeout, boolean modifyTimeout)
  {
    // Add code when running remotely
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "waiting");
      SibTr.exit(tc, "waiting", Long.valueOf(timeout));
    }

    return timeout;
  }
877346
public void setScanTimeout(int timeout) {
        scanTimeout = timeout;
        Log.i(TAG, String.format("New scan timeout set: %d seconds", scanTimeout));
    }
643012
public long timeout()
    {
        final long now = now();
        for (Entry<Timer, Long> entry : entries()) {
            final Timer timer = entry.getKey();
            final Long expiration = entry.getValue();

            if (timer.alive) {
                //  Live timer, lets return the timeout
                if (expiration - now > 0) {
                    return expiration - now;
                }
                else {
                    return 0;
                }
            }

            //  Remove it from the list of active timers.
            timers.remove(expiration, timer);
        }
        //  Wait forever as no timers are alive
        return -1;
    }
1198354
def wait_until_not_visible(self, timeout=None):
        
        try:
            self.utils.wait_until_element_not_visible(self, timeout)
        except TimeoutException as exception:
            parent_msg = " and parent locator '{}'".format(self.parent) if self.parent else ''
            msg = "Page element of type '%s' with locator %s%s is still visible after %s seconds"
            timeout = timeout if timeout else self.utils.get_explicitly_wait()
            self.logger.error(msg, type(self).__name__, self.locator, parent_msg, timeout)
            exception.msg += "\n  {}".format(msg % (type(self).__name__, self.locator, parent_msg, timeout))
            raise exception
        return self
1127331
@Override
  public int readTimeout(byte []buf, int offset, int length, long timeout)
    throws IOException
  {
    return read(buf, offset, length);
    /*
    Socket s = _s;
      
    if (s == null) {
      return -1;
    }
    
    int oldTimeout = s.getSoTimeout();
    s.setSoTimeout((int) timeout);
    
    try {
      int result = read(buf, offset, length);
      
      if (result >= 0) {
        return result;
      }
      else if (_is == null || _is.available() < 0) {
        return -1;
      }
      else {
        return ReadBuffer.READ_TIMEOUT;
      }
    } finally {
      s.setSoTimeout(oldTimeout);
    }
    */
  }
1350637
@Override
    public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
        if (this.m_coordinationLatch.await(timeout, unit) == false) {
            throw new TimeoutException();
        }

        if (m_pendingException != null) {
            if (m_pendingException instanceof ExecutionException) {
                throw (ExecutionException) m_pendingException;
            } else {
                throw (RuntimeException) m_pendingException;
            }
        }

        throw new CancellationException();
    }
875395
public static Timeout sum(Timeout... timeouts)
	{
		long sum = 0;

		for (Timeout timeout : timeouts)
			if (timeout != null)
				sum += timeout.getMilliseconds();

		if (sum != 0)
			return new Timeout(sum);
		else
			return Timeout.ZERO;
	}
438189
public long getBeanTimeoutTime(BeanId beanId) {
        TimeoutElement elt = ivStatefulBeanList.get(beanId);
        long timeoutTime = 0;
        if (elt != null) {
            if (elt.timeout != 0) {
                timeoutTime = elt.lastAccessTime + elt.timeout;
                if (timeoutTime < 0) { // F743-6605.1
                    timeoutTime = Long.MAX_VALUE; // F743-6605.1
                }
            }
        }
        return timeoutTime;
    }
317798
public Integer getTimeout()
   {
      if (childNode.getTextValueForPatternName("timeout") != null && !childNode.getTextValueForPatternName("timeout").equals("null")) {
         return Integer.valueOf(childNode.getTextValueForPatternName("timeout"));
      }
      return null;
   }
490196
def poll(self, timeout):
        
        now = time.time()
        end_time = now + float(timeout)
        prev_timeout = self.stream.gettimeout()
        self.stream.settimeout(self._poll_period)
        incoming = None
        try:
            while (end_time - now) >= 0:
                try:
                    incoming = self.stream.recv(self._max_read)
                except socket.timeout:
                    pass
                if incoming:
                    return incoming
                now = time.time()
            raise ExpectTimeout()
        finally:
            self.stream.settimeout(prev_timeout)
921669
public void get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
        sync.innerGet(unit.toNanos(timeout));
    }
188223
public function setTimeout($timeout)
    {
        $timeout = is_scalar($timeout) ? (int) $timeout : 0;

        return $timeout < 1
            ? $this->timeout
            : $this->timeout = $timeout;
    }
759874
public EmbeddedGobblin setJobTimeout(String timeout) {
    return setJobTimeout(Period.parse(timeout).getSeconds(), TimeUnit.SECONDS);
  }
1018000
public final void acquire(long timeout) throws RuntimeException {
		synchronized (this.LOCK) {
			long start = System.currentTimeMillis();

			while (this.owner != null) {
				if (this.owner.get() == Thread.currentThread()) {
					this.acquire++;

					return;
				}

				try {
					if (timeout == -1) {
						this.LOCK.wait();
					} else {
						this.LOCK.wait(timeout);
					}
				} catch (InterruptedException e) {
					//
				}

				long end = System.currentTimeMillis();

				if ((this.owner != null) && (timeout != -1)
						&& ((end - start) >= timeout)) {
					throw new RuntimeException("TimeoutException");
				}
			}

			this.owner = new WeakReference(Thread.currentThread());
			this.acquire++;
		}
	}
106298
def wait(self, timeout=None):
    
    if self._future:
      try:
        # Future.exception() will return rather than raise any exception so we use it.
        self._future.exception(timeout)
      except concurrent.futures.TimeoutError:
        self._timeout()
      self._refresh_state()
    else:
      # fall back to polling
      while not self.is_complete:
        if timeout is not None:
          if timeout <= 0:
            self._timeout()
          timeout -= Job._POLL_INTERVAL_SECONDS
        time.sleep(Job._POLL_INTERVAL_SECONDS)
    return self