Sets the heartbeat timer up.

@param int $interval The heartbeat interval in milliseconds.
351017
protected function setupHeartbeat($interval)
    {
        $this->heartbeatInterval = $interval;
        if (isset($this->heartbeatTimer)) {
            $this->heartbeatTimer->cancel();
        }

        $interval             = $interval / 1000;
        $this->heartbeatTimer = $this->loop->addPeriodicTimer($interval, [$this, 'heartbeat']);
        $this->heartbeat();

        $this->logger->info('heartbeat timer initilized', ['interval' => $interval * 1000]);
    }
876898
protected function setAndVerify($value, $interval)
    {
        if (!filter_var($value, FILTER_VALIDATE_INT) && $value != '0') {
            throw new InvalidArgumentException(sprintf("The %s should be an integer.", $interval));
        }
        $this->$interval = $value;
    }
1099929
@ReflectiveAccess
    protected void setInterval(String interval) {
        this.interval = ConversionService.SHARED.convert(interval, Duration.class).orElseThrow(() -> new IllegalArgumentException("Invalid Duration Specified"));
    }
927938
private static function resolveDateInterval($interval) : \DateInterval
    {
        if ($interval instanceof DateInterval) {
            return $interval->toInternalDateInterval();
        }
        
        if (is_string($interval)) {
            return new \DateInterval($interval);
        }
        
        if ($interval instanceof \DateInterval) {
            return $interval;
        }
        
        throw new \InvalidArgumentException('Interval must be a string or an instance of DateInterval.');
    }
1284843
public function now($interval = 0)
    {
        if ($interval) {
            $add = ' ' . ($interval > 0 ? '+' : '-') . ' INTERVAL ';
            $add .= $interval > 0 ? intval($interval) : intval($interval) * -1;
            $add .= ' SECOND';
        }

        return "now()" . $add;
    }
619083
public function set(int $offset, Period $interval): void
    {
        $this->get($offset);
        $this->intervals[$offset] = $interval;
    }
770411
public function addPeriodicTimer(int $interval, callable $callback): void
    {
        $this->loop->addPeriodicTimer($interval, $callback);
    }
64923
protected function setDuration($duration)
	{
		if (is_numeric($duration) && $duration >= 0)
		{
			$duration = new TimeInterval($duration);
		}
		
		if ( ! $duration instanceof TimeInterval)
		{
			throw new \InvalidArgumentException('The duration value must be a positive number value.');
		}
		
		$this->duration = $duration;
		
		return $this;
	}
1180824
public function setTimeout($timeout)
    {
        $timeout = intval($timeout);
        if (!empty($timeout)) {
            $this->timeout = $timeout;
        }
    }
677433
public function setExpiresIn(DateInterval $interval)
    {
        $this->expires = new DateTime();
        $this->expires->add($interval);
        return $this;
    }
56373
public void setHeartbeatInterval(short heartbeatInterval)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setHeartbeatInterval");
      properties.put(HEARTBEAT_INTERVAL, heartbeatInterval);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setHeartbeatInterval", ""+heartbeatInterval);
   }
155536
public function setMinTime(QtiDuration $minTime = null)
    {
        // Prevent to get 0s durations stored.
        if (is_null($minTime) === false && $minTime->getSeconds(true) === 0) {
            $minTime = null;
        }

        $this->minTime = $minTime;
    }
823091
public function setMin(int $min): void{
        if($this->max < $min){
            throw new \InvalidArgumentException();
        }

        $this->min  = $min;
    }
320660
public function push(Period $interval, Period ...$intervals): void
    {
        $this->intervals = array_merge($this->intervals, [$interval], $intervals);
    }
547140
public function insert(int $offset, Period $interval, Period ...$intervals): void
    {
        if ($offset < 0 || $offset > count($this->intervals)) {
            throw new InvalidIndex(sprintf('%s is an invalid offset in the current sequence', $offset));
        }

        array_unshift($intervals, $interval);
        array_splice($this->intervals, $offset, 0, $intervals);
    }
193357
def setup(self, interval):
        """"""
        self.trace_counter = 0

        self._halt = False
        self.interval = interval
341694
public function changeInterval($id, $interval) {
        return $this->webService->post("UPDATE 'PUSH'.'PUSHINTERVAL'", [
            self::PARAMETER_PUSH_ID => $id,
            self::PARAMETER_PUSH_INTERVAL => $interval
        ]);
    }