def get_duration(df):
    """Get duration of ECG recording

    Args:
        df (DataFrame): DataFrame with time/voltage data

    Returns:
        float: duration of ECG recording
    """
    start = df.time.iloc[0]
    end = df.time.iloc[-1]
    duration = end - start
    return duration