Benchmark code comparing two different version function.
()
| 60 | |
| 61 | |
| 62 | def benchmark() -> None: |
| 63 | """ |
| 64 | Benchmark code comparing two different version function. |
| 65 | """ |
| 66 | import timeit |
| 67 | |
| 68 | print( |
| 69 | timeit.timeit("solution()", setup="from __main__ import solution", number=1000) |
| 70 | ) |
| 71 | print( |
| 72 | timeit.timeit( |
| 73 | "solution_fast()", setup="from __main__ import solution_fast", number=1000 |
| 74 | ) |
| 75 | ) |
| 76 | |
| 77 | |
| 78 | if __name__ == "__main__": |
nothing calls this directly
no outgoing calls
no test coverage detected