import logging


def calc_duration(time):
    """This calculates the time duration of the ECG data.

    The time duration is found by subtracting the first time
    value from the last time value.

    Args:
        time (list): list of time values for the ECG data

    Returns:
        float : duration of ECG data in seconds
    """
    logging.info('Calculating ECG duration')
    first = time[0]
    last = time[-1]
    return last - first