import time
import statistics


def timereps(reps, func):
    """Helper function to call a function multiple times for benchmarking."""
    times = []
    for i in range(0, reps):
        start = time.time()
        func()
        times.append(time.time() - start)
    return statistics.mean(times)