Set a delay (positive or negative)

@param int $_time Delay in milliseconds
188617
public function shift($_time = 0)
    {
        if (!is_int($_time)) {
            return false;
        }
        if ($_time == 0) {
            return true;
        }

        $start = $this->getStartMS();
        $stop  = $this->getStopMS();

        $this->setStartMS($start + $_time);
        $this->setStopMS($stop + $_time);

        return true;
    }
1287076
public function setMaxTime(QtiDuration $maxTime = null)
    {
        // Prevent to get 0s durations stored.
        if (is_null($maxTime) === false && $maxTime->getSeconds(true) === 0) {
            $maxTime = null;
        }

        $this->maxTime = $maxTime;
    }
288248
public function negated() : Duration
    {
        if ($this->isZero()) {
            return $this;
        }

        $seconds = -$this->seconds;
        $nanos = $this->nanos;

        if ($nanos !== 0) {
            $nanos = LocalTime::NANOS_PER_SECOND - $nanos;
            $seconds--;
        }

        return new Duration($seconds, $nanos);
    }
757893
public function set_time($time = null) {
        if (empty($time)) {
            $this->time = time();
        } else {
            $this->time = $time;
        }

        return $this;
    }
929773
public function setMinValidity($time) {
        if (!is_int($time)) throw new IllegalTypeException('Illegal type of parameter $time: '.gettype($time));
        if ($time < 0)      throw new InvalidArgumentException('Invalid argument $time: '.$time);

        $this->minValidity = $time;

        return $this;
    }
581577
public function setDisconnectTime($milliseconds = null)
    {
        if (is_integer($milliseconds)
             && $milliseconds >= self::DEF_DISCONNECT_TIME
        ) {
            $this->_disconnecttime = $milliseconds;
        } else {
            $this->_disconnecttime = self::DEF_DISCONNECT_TIME;
        }
        return $this->_disconnecttime;
    }
246359
function set_timeout($timeout_recv, $timeout_send)
    {
        $_timeout_recv_sec = (int)$timeout_recv;
        $_timeout_send_sec = (int)$timeout_send;

        $this->timeout_recv = $timeout_recv;
        $this->timeout_send = $timeout_send;

        $_timeout_recv = array(
            'sec' => $_timeout_recv_sec,
            'usec' => (int)(($timeout_recv - $_timeout_recv_sec) * 1000 * 1000)
        );
        $_timeout_send = array(
            'sec' => $_timeout_send_sec,
            'usec' => (int)(($timeout_send - $_timeout_send_sec) * 1000 * 1000)
        );

        $this->setopt(SO_RCVTIMEO, $_timeout_recv);
        $this->setopt(SO_SNDTIMEO, $_timeout_send);
    }
1187799
public function delay($time)
    {
        if (Event::fire(Event::JOB_DELAY, array($this, $time)) === false) {
            return false;
        }

        $this->redis->sadd(Queue::redisKey(), $this->queue);
        $status = $this->redis->zadd(Queue::redisKey($this->queue, 'delayed'), $time, $this->payload);

        if ($status < 1) {
            return false;
        }

        $this->setStatus(self::STATUS_DELAYED);
        $this->redis->hset(self::redisKey($this), 'delayed', $time);

        Stats::incr('delayed', 1);
        Stats::incr('delayed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_DELAYED, array($this, $time));

        return true;
    }
409782
function delay(timeout, value) {
        if (timeout < 0) {
            return value;
        }

        var future = new Future();
        setTimeout(function () {
            future.resolve(value);
        }, timeout);
        return future;
    }
1283451
protected function setTimeout()
    {
        $this->timeoutTimer = $this->loop->addTimer(
            self::CONNECTION_TIMEOUT,
            function () {
                $this->close();
            }
        );
    }
144507
protected function setFinished($time = null)
    {
        $this->finished = $time ?: microtime(true);
        $this->setState(RunInterface::STATE_NOT_RUNNING);
    }
617289
public function modify($modify)
    {
        if (preg_match('/(\+|-)([0-9]+)(?:\s?)(?:microseconds|microsecond|micro|mic)$/', $modify, $matches)) {
            $modify = str_replace($matches[0], '', $modify);
            $number = intval($matches[2]);
            switch ($matches[1]) {
                case '-':
                    $this->subMicroseconds($number);
                    break;
                case '+':
                    $this->addMicroseconds($number);
                    break;
            }
        }

        if (!$modify) {
            $modify = '0 seconds';
        }

        return parent::modify($modify);
    }
729128
private static void waiting(int milliseconds) {
        long t0, t1;
        t0 = System.currentTimeMillis();
        do {
            t1 = System.currentTimeMillis();
        } while ((t1 - t0) < milliseconds);
    }
862423
public function setTime($time)
    {
        //argument 1 must be an integer or string
        Argument::i()->test(1, 'int', 'string');
        if (is_string($time)) {
            $time = strtotime($time);
        }

        $this->time = $time - $this->offset;
        return $this;
    }
256661
@SuppressWarnings("unchecked")
  public T delay(int milliseconds, String name, Function... funcs) {
    for (Element e : elements()) {
      queue(e, name, new DelayFunction(e, name, milliseconds, funcs));
    }
    return (T) this;
  }
561891
static function setScriptStop( $time = false )
    {
        if ( $time === false )
            $time = microtime( true );
        $debug = eZDebug::instance();
        $debug->ScriptStop = $time;
    }
692739
def setfd(self, time):
        
        _runshell([brctlexe, 'setfd', self.name, str(time)],
            "Could not set forward delay in %s." % self.name)