import logging


def duration(time):
    """Calculates time span of ECG strip data

    The time span of the provided data indicates for how long
    the ECG test was administered and provides a benchmark
    for the number of expected heart beats.

    Args:
        time (list): time data of the ECG strip

    Returns:
        float: time duration of ECG strip
    """
    logging.info("Calculating time span of ECG trace")
    timespan = time[-1] - time[0]
    return timespan