added docstring

This commit is contained in:
2025-11-05 19:20:01 +01:00
parent 5137dd1475
commit d36204b755

View File

@@ -3,6 +3,12 @@ import timeit
def timeit_verbose(func, min_time=0.2, target_time=2, min_repeat=3):
"""
time the given func
number of runs per repeat is chosen such that the total time per repeat >= min_time
number of repeats is chosen such that the total time overall ~ target_time, but at least min_repeat
returns the average and std dev per run as well as a human-readable message
"""
timer = timeit.Timer(func)
number, repeat = find_number_and_repeat(timer, min_time, target_time, min_repeat)
times = run_timer(timer, number, repeat)