protected function getRangeDuration($start, $end)
    {
        // the two TimePoint must have the same target to be consistent
        if ($start->getTarget() != $end->getTarget()) {
            throw new InconsistentRangeException('A time range must be defined by two TimePoint with the same target');
        }

        // the two TimePoint must be correctly ordered
        $rangeDuration = $end->getTimestamp() - $start->getTimestamp();
        if ($rangeDuration < 0) {
            throw new InconsistentRangeException('A START TimePoint cannot take place after the END!');
        }

        return $rangeDuration;
    }
protected function getRangeDuration($start, $end)
    {
        
        if ($start->getTarget() != $end->getTarget()) {
            throw new InconsistentRangeException('A time range must be defined by two TimePoint with the same target');
        }

        
        $rangeDuration = $end->getTimestamp() - $start->getTimestamp();
        if ($rangeDuration < 0) {
            throw new InconsistentRangeException('A START TimePoint cannot take place after the END!');
        }

        return $rangeDuration;
    }
protected function getRangeDuration ( $ start , $ end ) { // the two TimePoint must have the same target to be consistent if ( $ start -> getTarget ( ) != $ end -> getTarget ( ) ) { throw new InconsistentRangeException ( 'A time range must be defined by two TimePoint with the same target' ) ; } // the two TimePoint must be correctly ordered $ rangeDuration = $ end -> getTimestamp ( ) - $ start -> getTimestamp ( ) ; if ( $ rangeDuration < 0 ) { throw new InconsistentRangeException ( 'A START TimePoint cannot take place after the END!' ) ; } return $ rangeDuration ; }
Computes the duration between two TimePoint
@param TimePoint $start
@param TimePoint $end
@return float
@throws InconsistentRangeException
Computes the duration between two TimePoint