Benchmark a function and return execution time.
(func, *args, **kwargs)
| 30 | |
| 31 | |
| 32 | def benchmark_function(func, *args, **kwargs): |
| 33 | """Benchmark a function and return execution time.""" |
| 34 | start_time = time.perf_counter() |
| 35 | result = func(*args, **kwargs) |
| 36 | end_time = time.perf_counter() |
| 37 | return end_time - start_time, result |
| 38 | |
| 39 | |
| 40 | def create_test_data(size): |
no outgoing calls
no test coverage detected