def elapsed_time_printed(current_time_func=time, formatter=friendly_delta_from_secs):
    """Print time elapsed during "with block" execution.

    That is, print the time between the beginning
    of the "with block" (just before yielding) and
    its end (just after yielding, when execution
    flow returns to this generator).

    Parameters
    ==========
    current_time_func (callable)
        used to obtain the value of the current time;
        default is time.time() from standard library,
        which returns the current time in seconds since
        the Epoch.
    formatter (callable)
        execution time is passed through this callable
        before being printed.
    """
    ### store the start time
    start = current_time_func()

    ### yield so we enter the "with block"
    yield

    ### store difference between current and start time
    execution_time = current_time_func() - start

    ### print formated execution time
    print(formatter(execution_time))
Print time elapsed during "with block" execution.

    That is, print the time between the beginning
    of the "with block" (just before yielding) and
    its end (just after yielding, when execution
    flow returns to this generator).

    Parameters
    ==========
    current_time_func (callable)
        used to obtain the value of the current time;
        default is time.time() from standard library,
        which returns the current time in seconds since
        the Epoch.
    formatter (callable)
        execution time is passed through this callable
        before being printed.
    
nodezator/ourstdlibs/profileutils.py