import csv


def parse_latency_stats(fp):
    """
    Parse latency statistics.
    :param fp: the file path that stores the statistics
    :returns an average latency in milliseconds to connect a pair of initiator and responder clients
    """
    latency = []
    with open(fp) as csvfile:
        csvreader = csv.DictReader(csvfile, delimiter=' ', fieldnames=['title', 'time'])
        for row in csvreader:
            latency.append(float(row['time']) * 1000)
    return sum(latency) / len(latency)