Fill timeout options

@param $timeout
@param $optionName
@param $optionNameMs

@return array
432232
private function fillTimeoutOptions($timeout, $optionName, $optionNameMs): array
    {
        $timeoutOptions = [];

        if (is_int($timeout)) {
            $timeoutOptions[$optionName] = $timeout;
        } elseif (is_float($timeout)) {
            $timeoutOptions[$optionNameMs] = $timeout * 1000;
            $timeoutOptions[CURLOPT_NOSIGNAL] = 1;
        }

        return $timeoutOptions;
    }
115638
public function setTimeout($timeout) {
            $this->timeout = $timeout;
            $this->process->setTimeout($this->timeout);
            return $this;
        }
840292
public ConverterServerBuilder processTimeout(long processTimeout, TimeUnit timeUnit) {
        assertNumericArgument(processTimeout, false);
        this.processTimeout = timeUnit.toMillis(processTimeout);
        return this;
    }
1226270
public function setConnectTimeout($timeout)
    {
        assert(is_int($timeout));
        assert($timeout >= 0);
        $this->_timeout = $timeout;

        return $this;
    }
978964
function timeout(timeoutMS) {
        var id;
        return new Promise(
            function (c) {
                if (timeoutMS) {
                    id = _Global.setTimeout(c, timeoutMS);
                } else {
                    _BaseCoreUtils._setImmediate(c);
                }
            },
            function () {
                if (id) {
                    _Global.clearTimeout(id);
                }
            }
        );
    }
496070
public function setTimeout($timeout)
    {
        if (is_string($timeout) && ctype_digit($timeout)) {
            $timeout = (int) $timeout;
        } elseif (!is_int($timeout)) {
            throw new \RuntimeException('Unable to set timeout.');
        }
        $this->timeout = $timeout;

        return $this;
    }
208499
public function iterate($timeout)
    {

        // call parent method and sleep for the default timeout
        parent::iterate($timeout);

        // create the instance and stack it
        $this->synchronized(function ($self) {

            // create the instance only if we're NOT dispatched and a class name is available
            if ($self->dispatched === false && $self->className) {
                // create the instance
                $instance = $self->getApplication()->search(ProviderInterface::IDENTIFIER)->get($self->className);

                // stack the instance
                $self->instances[] = $instance;

                // we're dispatched now
                $self->dispatched = true;
            }

        }, $this);
    }
294467
public function setTimeout($timeout = 60)
    {
        $this->timeout = $timeout;
        $this->debug->info(__FUNCTION__, 'setTimeout: ', $this->timeout);

        return $this;
    }
1040719
def with_timeout(time=@options[:timeout])
      raise ArgumentError, "Block required" if !block_given?
      if Munin::TIMEOUT_CLASS.respond_to?(:timeout_after)
        Munin::TIMEOUT_CLASS.timeout_after(time) { yield }
      else
        Munin::TIMEOUT_CLASS.timeout(time) { yield }
      end
    end
411559
public static Timeout min(Timeout... timeouts)
	{
		Timeout min = null;

		for (Timeout timeout : timeouts)
		{
			if (timeout != null)
				if (min == null || min.getMilliseconds() > timeout.getMilliseconds())
					min = timeout;
		}

		if (min != null)
			return min;
		else
			throw new IllegalArgumentException("Must specify at least one non-null timeout!");
	}
270552
protected int getTimeout(Dsn dsn) {
        return Util.parseInteger(Lookup.lookup(TIMEOUT_OPTION, dsn), TIMEOUT_DEFAULT);
    }
629215
private function create($name, $timeout = null)
    {
        if(null === $timeout) {
            $timeout = 10000;
        }

        $sql = 'INSERT INTO ' . $this->queueTable . '
            (queue_name, timeout)
            VALUES
            (:queue_name, :timeout)
            ';
        $stmt = $this->getDb()->prepare($sql);
        $stmt->bindParam(':queue_name', $name, \PDO::PARAM_STR);
        $stmt->bindParam(':timeout', $timeout, \PDO::PARAM_INT);
        $stmt->execute();
        return true;
    }
1180116
public function getNamedLock($name, $timeout = 15)
    {
        $stmt = $this->query('SELECT GET_LOCK("' . $name . '", '.$timeout .')');
        return $stmt->fetch(self::FETCH_COLUMN);

    }
1327635
public function wait($timeout = 60)
    {
        $timeoutMicro = $timeout !== null ? microtime(true) + (float)$timeout : null;
        while ($this->isRunning()) {
            if ($timeout !== null && microtime(true) >= $timeoutMicro) {
                return null;
            }
            usleep(1000);
        }

        return $this->getExitCode();
    }
1265529
public function timeout($timeout = null, $connectTimeout = null)
    {
        if(null !== $timeout)
        {
            $this->timeout = $timeout;
        }
        if(null !== $connectTimeout)
        {
            $this->connectTimeout = $connectTimeout;
        }
        return $this;
    }
297662
public function recover($timeout = 900)
    {
        foreach (new DirectoryIterator($this->path) as $file) {
            $file = $file->getRealPath();

            if ('.message.sending' == substr($file, -16)) {
                $lockedtime = filectime($file);
                if ((time() - $lockedtime) > $timeout) {
                    rename($file, substr($file, 0, -8));
                }
            }
        }
    }
1082289
public function executeCommand($cmd, $timeout = 300)
    {
        $php = escapeshellarg($this->getPhp());
        $process = new Process($php.' '.$this->root_dir.'console '.$cmd, $this->root_dir.'/../', null, null, $timeout);
        $process->run(function ($type, $buffer) {
            echo $buffer;
        });

        if (!$process->isSuccessful()) {
            throw new \RuntimeException(sprintf('An error occurred when executing the "%s" command.', $cmd));
        }
    }