import time


def timer(func, times=1):
    """
    Run a function in loop, the number of repeats is given by argument times.
    Return the total time in seconds.
    This function can't receive any argument of func. Use func from functools.partial instead.
    """
    start = time.time()
    for i in range(times):
        func()
    run_time = time.time() - start
    return run_time