import time


def measure(f, repetitions=1000):
    """Measures CPU mean time consumed by f method call repeated `repetitions` times (in fractional seconds)"""
    elapsed = 0
    for _ in range(repetitions):
        start = time.process_time()
        f()
        end = time.process_time()
        elapsed += end - start
    return elapsed / repetitions