def check_input_duration(duration, metrics):
    """Checks if the time duration input by the user falls within the ECG file.

    Args:
        duration (tuple): contains start and stop times in minutes as input
            by the user
        metrics (dict): dictionary of ECG metrics calculated by the program.

    Returns:
        bool: returns true is the input duration is within the ECG signal
            otherwise an error is raised.
    """

    # Get the specified duration in seconds
    duration_seconds = duration[1]
    duration_seconds *= 60

    # Compare against the duration of the ECG signal
    within_signal = duration_seconds <= metrics['duration']

    if not within_signal:
        print('Invalid input final bound (%0.2f minutes) is '
              'greater than ECG duration (%0.2f minutes)!'
              % (duration_seconds/60, (metrics['duration']/60)))
        raise ValueError

    else:
        return True