Measure time between $stop and $start
@param $label
@param float $start  microseconds timestamp
@param float $stop   microseconds timestamp
480359
public static function addMeasure($label,$start,$stop){
		self::debugbar()->addMeasure($label,$start,$stop);
	}
1038972
public void startTiming(String label) {
        if (mPerfWriter != null)
            mPerfWriter.writeStartTiming(label);
        mPerfMeasurement = new Bundle();
        mPerfMeasurement.putParcelableArrayList(
                METRIC_KEY_ITERATIONS, new ArrayList<Parcelable>());
        mExecTime = SystemClock.uptimeMillis();
        mCpuTime = Process.getElapsedCpuTime();
    }
137101
public final boolean between(@Nonnull UtcTime begin, @Nonnull UtcTime end) {
    return (time >= begin.time) && (time <= end.time);
  }
1040613
public static function mark($label = '')
    {
        $_this = self::i();
        if (!$_this->isDebug()) {
            return false;
        }

        $current = $_this->_microtime() - $_this->_start;
        $memory  = self::_getMemory();
        $trace   = debug_backtrace();

        $markInfo = array(
            'time'       => $current,
            'timeDiff'   => $current - $_this->_prevTime,
            'memory'     => $memory,
            'memoryDiff' => $memory - $_this->_prevMemory,
            'trace'      => $_this->_getSourcePath($trace, true),
            'label'      => $label,
        );

        $_this->_bufferInfo[] = $markInfo;

        if ((int)self::$_config['profiler']['render'] & self::PROFILER_RENDER_FILE) {
            $_this->log(self::_profilerFormatMark($markInfo), 'mark #');
        }

        $_this->_prevTime   = $current;
        $_this->_prevMemory = $memory;

        return $_this;
    }
1297487
public function addLabel(Label $label)
    {
        if (!$this->labels->contains($label)) {
            $this->labels->add($label);
            $label->setInteractionMatching($this);
        }
    }
294390
public static function calcElapsedTime($start, $end, $precision = 8) {
		$elapsed = $end - $start;
		return round($elapsed, $precision);
	}
182228
public static function getDuration($start)
    {
        $time = microtime();
        $time = explode(' ', $time);
        $time = $time[1] + $time[0];
        $finish = $time;
        
        return round(($finish - $start), 4);
    }
678133
public function setInterval( $start, $end )
	{
		if( $start * $end > 0 )
			throw new InvalidArgumentException( 'Interval needs to start below 0.' );
		$this->interval	= new Alg_Math_CompactInterval( $start, $end );
	}
843792
public function zRemRangeByRank($key, $start, $stop) {
        return $this->getHandler($this->judge(__FUNCTION__))->zRemRangeByRank($key, $start, $stop);
    }
693117
public function getElapsedInMilliseconds() : float
    {
        if ($this->startedOn === null) {
            throw new NotStartedException();
        }

        return ($this->stoppedOn === null) ?
            $this->toMilli(microtime(true) - $this->startedOn) :
            $this->getDurationInMilliseconds();
    }
398117
public function startMeasure($name, $label = null)
    {
        if ($this->hasCollector('time')) {
            /** @var \Songshenzong\Log\DataCollector\TimeDataCollector $collector */
            $collector = $this->getCollector('time');
            $collector->startMeasure($name, $label);
        }
    }
550432
public function computeNumTimesFiredBetween(\DateTime $start, \DateTime $end)
    {
        if ($this->getRepeatInterval() < 1) {
            return 0;
        }

        $time = ((int) $end->format('U')) - ((int) $start->format('U'));

        return (int) ($time / $this->getRepeatInterval());
    }
1085598
function stop(): int {
        if($this->timer === null) {
            return 0;
        }
        
        if($this->nativeHrtime) {
            $elapsed = (int) (\hrtime(true) - $this->timer);
        } elseif($this->hrtime) {
            $this->timer->stop();
            $elapsed = (int) $this->timer->getElapsedTime(\HRTime\Unit::NANOSECOND);
        } else {
            $elapsed = \microtime(true) - $this->timer;
            $elapsed = \ceil(($elapsed * 1000000000));
        }
        
        return ((int) $elapsed);
    }
1126366
function endTimer()
    {
        $this->EndTime = microtime( true );
        // Calculate time taken in ms
        $this->TimeTaken = $this->EndTime - $this->StartTime;
        $this->TimeTaken *= 1000.0;
    }
157325
public function addMeasure($label, $start, $end, $params = array(), $collector = null)
    {
        $this->measures[] = array(
            'label' => $label,
            'start' => $start,
            'relative_start' => $start - $this->requestStartTime,
            'end' => $end,
            'relative_end' => $end - $this->requestEndTime,
            'duration' => $end - $start,
            'duration_str' => $this->getDataFormatter()->formatDuration($end - $start),
            'params' => $params,
            'collector' => $collector
        );
    }
263961
public function measureTime(string $timerId, string $timerTitle, callable $callback)
    {
        $debugger = $this['debugger'];
        $debugger->startTimer($timerId, $timerTitle);
        $result = $callback();
        $debugger->stopTimer($timerId);

        return $result;
    }
734678
public static function print_timer($timer, $label = 'Timer', $dest = 'console')
    {
        static $print_count = 0;

        $print_count++;
        $now  = self::timer();
        $diff = $now - $timer;

        if (empty($label)) {
            $label = 'Timer '.$print_count;
        }

        self::write_log($dest, sprintf("%s: %0.4f sec", $label, $diff));
    }