MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / benchmark

Function benchmark

project_euler/problem_187/sol1.py:142–157  ·  view source on GitHub ↗

Benchmarks

()

Source from the content-addressed store, hash-verified

140
141
142def benchmark() -> None:
143 """
144 Benchmarks
145 """
146 # Running performance benchmarks...
147 # slow_solution : 108.50874730000032
148 # while_sol : 28.09581200000048
149 # solution : 25.063097400000515
150
151 from timeit import timeit
152
153 print("Running performance benchmarks...")
154
155 print(f"slow_solution : {timeit('slow_solution()', globals=globals(), number=10)}")
156 print(f"while_sol : {timeit('while_solution()', globals=globals(), number=10)}")
157 print(f"solution : {timeit('solution()', globals=globals(), number=10)}")
158
159
160if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected