def compute_change(labels, before, after):
    """
     Compute the difference between CPU times from consecutive measurements.

    :param [str] labels: Label for each result.
    :param before: Times collected per process name for time 0.
    :param after: Times collected per process name for time 1.
    :return: Dictionary mapping labels to dictionaries mapping process
        names to elapsed CPU time between measurements.
    """
    result = {}
    for (label, before, after) in zip(labels, before, after):
        matched_keys = set(before) & set(after)
        value = {key: after[key] - before[key] for key in matched_keys}
        result[label] = value
    return result