Seconds remaining until a new time window opens

@return null
325638
public function getRateReset()
    {
        if (!$this->lastResponse) {
            return null;
        }

        /** @var Header $limit */
        $limit = $this->lastResponse->getHeader('X-Rate-Reset');

        return $limit ? $limit->normalize() : null;
    }
1034009
public function timeStart()
    {
        $now = explode(" ", microtime());
        $this->startTime = $now[1] + $now[0];

        return $this->startTime;
    }
545391
public function getTimeStamp()
    {
        if (!isset($this->timestamp)) {
            $this->handler->populateTimestamp($this);
        }
        return $this->timestamp;
    }
1131976
public function getTime()
    {
        $time = 0;
        foreach ($this->data['queries'] as $query) {
            $time += (float) $query['time'];
        }

        return $time;
    }
541411
public function resetOneTimeValues()
    {
        $this->prefix = null;

        $this->suffix = null;

        $this->fakerString = null;

        return $this;
    }
626455
protected function _timedOut()
    {
        $time = $this->read('Config.time');
        $result = false;

        $checkTime = $time !== null && $this->_lifetime > 0;
        if ($checkTime && (time() - (int)$time > $this->_lifetime)) {
            $result = true;
        }

        $this->write('Config.time', time());

        return $result;
    }
1159490
protected function heartbeatAgo()
    {
        if ($this->getParameter('value') != null) {
            $min = $this->getParameter('value');

            if ($min < 60)
                return $min.' min ago';
            elseif ($min < 1440)
                return floor($min / 60).' hrs '.($min % 60 > 0 ? floor($min % 60) .' min ' : '').'ago';
            else
                return floor($min / (24*60)).' days '.($min % (24*60) > 0 ? floor($min % (24*60) / 60).' hrs ' : '').'ago';
        }
    }
996900
private function getCurrentTime()
    {
        list ($msec, $sec) = explode(" ", microtime());
        return (float)$msec + (float)$sec;
    }
394931
public function wait_for_second( $second = 1 )
	{
		$second = $this->replace_variables( $second );
		$this->getSession()->wait( $second * 1000 );
	}
357740
public static function getHourTimestamp($now = null) {
        $now = $now === null ? time() : $now;
        $diff = $now % 3600; // 1 * 60 * 60;
        return $now - $diff;
    }
909314
private function getTimezonesHavingNewDaySinceLastRun()
    {
        $timestamp = $this->lastSuccessRunTimestamp;
        $uniqueTimezones = APISitesManager::getInstance()->getUniqueSiteTimezones();
        $timezoneToProcess = array();
        foreach ($uniqueTimezones as &$timezone) {
            $processedDateInTz = Date::factory((int)$timestamp, $timezone);
            $currentDateInTz = Date::factory('now', $timezone);

            if ($processedDateInTz->toString() != $currentDateInTz->toString()) {
                $timezoneToProcess[] = $timezone;
            }
        }
        return $timezoneToProcess;
    }
44050
public function getStartTime() {
        if (!isset($this->startTime)) {
            $this->startTime = (string)$this->getData(OntologyDeliveryExecution::PROPERTY_TIME_START);
        }
        return $this->startTime;
    }
1252499
public function elapsedTime() {
        $currentTime = microtime(true);
        if ($this->startTime === null) {
            $this->startTime            = $currentTime;
            $this->finishTime           = $currentTime;
        } else {
            $this->finishTime           = $currentTime;
            $this->elapsedTimeFromStart = $currentTime - $this->startTime;
        }
    }
424428
public function getDtEnd()
    {
        if (!$this->valid()) {
            return;
        }
        $end = clone $this->currentDate;

        return $end->modify('+'.$this->eventDuration.' seconds');
    }
413745
private function timeNow()
    {
        $currentHour = date('H');
        $currentMin = date('i');
        $currentSec = date('s');
        $currentMon = date('m');
        $currentDay = date('d');
        $currentYear = date('y');
        return mktime($currentHour, $currentMin, $currentSec, $currentMon, $currentDay, $currentYear);
    }
1302096
public function nanoSeconds()
    {
        return $this->nanoSeconds === null
            ? (int) $this->value->format('u') * 1000
            : $this->nanoSeconds;
    }
1051022
private static function keepSecondsWithinTimeout($seconds, $timedOut)
    {
        if (is_null($timedOut)) {
            return $seconds;
        }
        $remainingSeconds = max($timedOut - microtime(true), 0);
        return min($remainingSeconds, $seconds);
    }