import time


def time_sorting(sort_fxn, data):
    """ Record the run times for each run of a sorting function

    :param sort_fxn:
        The sort function of form sort_fxn(vec) to call
    :param data:
        A list of vectors to sort
    :returns:
        A list of run times to sort each element in data
    """
    times = [time.process_time()]
    for vec in data:
        sort_fxn(vec)
        times.append(time.process_time())
    return [t1 - t0 for t0, t1 in zip(times[:-1], times[1:])]