import time


def launchPhaseRetrieval(experiment, do):
    """
    launches the phase retrieval algorithms set to true in do

    Args:
        experiment (Object): contains all experiment parameters and methods.
        do (DICT): boolean associated to each phase retrieval method.

    Returns:
        processing_time (float): Processing time of the different algos.

    """
    processing_time={}
    
    for method, to_do in do.items():
        if to_do:
            time0=time.time()
            experiment.process_method(method)
            processing_time[method]=time.time()-time0
            
    return processing_time