Starts to capture

@param integer $timestamp Last modified timestamp
@param integer $ttl Time to live in seconds
@return void
6004
public function configure($timestamp, $ttl)
    {
        if ($this->isModified($timestamp)) {
            $this->appendLastModified($timestamp, $ttl);
        } else {
            $this->appendNotModified($ttl);
        }
    }
668143
public function ttl(int $seconds = null): int
    {
        if (is_int($seconds) && $seconds >= 0) {
            $this->ttl = $seconds;
        }

        return $this->ttl;
    }
950501
public function save( $id, $value, $ttl = 0 ) {

		$this->count++;
		$this->cacheInserts++;

		if ( $this->contains( $id ) ) {
			$this->count--;
			$this->moveToMostRecentlyUsedPosition( $id );
		} elseif ( $this->count > $this->maxCacheCount ) {
			$this->count--;
			reset( $this->cache );
			unset( $this->cache[ key( $this->cache ) ] );
		}

		$this->cache[ $id ] = $value;
		$this->ttl[ $id ] = $ttl > 0 ? microtime( true ) + $ttl : 0;
	}
493683
function setTimeOfDay( $timestamp )
    {
        $this->Time = $timestamp % self::SECONDS_A_DAY;
        if ( $this->Time < 0 )
            $this->Time += self::SECONDS_A_DAY;
        $this->IsValid = $this->Time >= 0;
    }
618923
public function process_auto_save($timestamp) {
        global $DB;

        $transaction = $DB->start_delegated_transaction();

        $this->quba->process_all_autosaves($timestamp);
        question_engine::save_questions_usage_by_activity($this->quba);

        $transaction->allow_commit();
    }
970430
public function setCookieLifetime($ttl)
    {
        if (!is_null($ttl)
            && !is_numeric($ttl)
        ) {
            throw new InvalidArgumentException("No valid ttl provided");
        }

        $this->cookieLifetime = (int)$ttl;

        return $this;
    }
1046423
protected function getSeconds($ttl)
    {
        $duration = $this->parseDateInterval($ttl);

        if ($duration instanceof DateTimeInterface) {
            $duration = Carbon::now()->diffInRealSeconds($duration, false);
        }

        return (int) $duration > 0 ? $duration : 0;
    }
142723
private static function timestampToCounter($timestamp, $timeStep)
    {
        $timestamp = abs(intval($timestamp));
        $counter = intval(($timestamp * 1000) / ($timeStep * 1000));

        return $counter;
    }
733295
public function store($prefix, $key, $default, $timestamp, $ttl)
	{
		$value = $this->processDefault($default);

		if ($value === null) {
			return $value;
		}

		$this->driver->set($prefix, $key, $value, $timestamp, $ttl);

		return $value;
	}
1087525
public function setLastVisit($timestamp = 'now')
	{
		$timestamp = new Date($timestamp);

		$query = $this->getQuery()
			->update($this->getTableName())
			->set(array('lastvisitDate' => $timestamp->toSql()))
			->whereEquals('id', $this->get('id'));

		return $query->execute();
	}
1322231
private function normalizeTtl($ttl)
    {
        if ($ttl === null) {
            return self::DEFAULT_TTL; // Default TTL is one hour
        }

        if (\is_int($ttl)) {
            return $ttl;
        }

        if ($ttl instanceof DateInterval) {
            $currentDateTime = new \DateTimeImmutable();
            $ttlDateTime = $currentDateTime->add($ttl);

            return $ttlDateTime->getTimestamp() - $currentDateTime->getTimestamp();
        }

        throw new InvalidArgumentException('Invalid TTL: ' . print_r($ttl, true));
    }
1129202
public function do_gc($ttl)
    {
        /** @var \ManaPHP\DbInterface $db */
        $db = $this->_di->getShared($this->_db);

        $db->query($this->_source)->whereCmp('expired_time', '<=', time())->delete();

        return true;
    }
1333331
protected function hasExpired($ttl, int $createdTime)
    {
        if ($ttl === null) {
            return false;
        }

        return (time() > ($ttl + $createdTime));
    }
706735
private function makeStartingTimestamp($window, $timestamp, $oldTimestamp)
    {
        return $oldTimestamp === Constants::ARGUMENT_NOT_SET
            ? $timestamp - $this->getWindow($window)
            : max($timestamp - $this->getWindow($window), $oldTimestamp + 1);
    }
66002
public function setTimestamp($timestamp = 0)
    {
        $this->timestamp = $timestamp;
        if ($timestamp === 0) {
            $this->timestamp = $this->generateTimestamp();
        }
        return $this;
    }
983718
public function set($key, $value, $ttl)
    {
        $filename = $this->_hash(array($key));

        return (bool) $this->_write($filename, $value, null, $ttl);
    }
454341
public function setExpireAtMilliSeconds(int $timestamp): bool
    {
        return $this->handle->pExpireAt($this->name, $timestamp);
    }