import time


def time_call(func, args, timer, time_name:str):
    """Times the function call by updating the timer object with the time_name attribute.
    Args:
        func: function to call
        args: arguments to func
        timer: timer object that contains times and counts
        time_name: name of timer attribute
    Returns:
        output: output of func call
        timer: timer object with updated times and counts
    """

    start_time = time.time()
    output = func(args)
    timer.update(time_name, time.time() - start_time)
    
    return output, timer