def METHOD_NAME(gc, func):
    """ Run a function multiple times and generate some stats
    """
    duration = 0.0
    times = []
    while duration < _MAX_DURATION:
        gc.clear()
        t0 = time.perf_counter()
        try:
            func()
        except Exception:
            # Not all backends support everything
            break
        times.append(time.perf_counter() - t0)
        duration += times[-1]
    if not times:
        return None
    times = np.array(times)
    return BenchTiming(
        count=len(times),
        mean=times.mean() * 1000,
        minimum=times.min() * 1000,
        maximum=times.max() * 1000,
        stddev=times.std() * 1000,
    )