src/Profiler.php
public function getTimeBetween($first, $second)
	{
		if (!isset($this->lookup[$first]))
		{
			throw new \LogicException(
				sprintf(
					'The point %s was not marked in the profiler %s.',
					$first,
					$this->name
				)
			);
		}

		if (!isset($this->lookup[$second]))
		{
			throw new \LogicException(
				sprintf(
					'The point %s was not marked in the profiler %s.',
					$second,
					$this->name
				)
			);
		}

		$indexFirst  = $this->lookup[$first];
		$indexSecond = $this->lookup[$second];

		$firstPoint  = $this->points[$indexFirst];
		$secondPoint = $this->points[$indexSecond];

		return abs($secondPoint->getTime() - $firstPoint->getTime());
	}
public function getTimeBetween($first, $second)
	{
		if (!isset($this->lookup[$first]))
		{
			throw new \LogicException(
				sprintf(
					'The point %s was not marked in the profiler %s.',
					$first,
					$this->name
				)
			);
		}

		if (!isset($this->lookup[$second]))
		{
			throw new \LogicException(
				sprintf(
					'The point %s was not marked in the profiler %s.',
					$second,
					$this->name
				)
			);
		}

		$indexFirst  = $this->lookup[$first];
		$indexSecond = $this->lookup[$second];

		$firstPoint  = $this->points[$indexFirst];
		$secondPoint = $this->points[$indexSecond];

		return abs($secondPoint->getTime() - $firstPoint->getTime());
	}
public function getTimeBetween ( $ first , $ second ) { if ( ! isset ( $ this -> lookup [ $ first ] ) ) { throw new \ LogicException ( sprintf ( 'The point %s was not marked in the profiler %s.' , $ first , $ this -> name ) ) ; } if ( ! isset ( $ this -> lookup [ $ second ] ) ) { throw new \ LogicException ( sprintf ( 'The point %s was not marked in the profiler %s.' , $ second , $ this -> name ) ) ; } $ indexFirst = $ this -> lookup [ $ first ] ; $ indexSecond = $ this -> lookup [ $ second ] ; $ firstPoint = $ this -> points [ $ indexFirst ] ; $ secondPoint = $ this -> points [ $ indexSecond ] ; return abs ( $ secondPoint -> getTime ( ) - $ firstPoint -> getTime ( ) ) ; }
Get the elapsed time in seconds between the two points.

@param   string  $first   The name of the first point.
@param   string  $second  The name of the second point.

@return  float  The elapsed time between these points in seconds.

@since   1.0
@throws  \LogicException  If the points were not marked.
Get the elapsed time in seconds between the two points .