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

Function benchmark

maths/euclidean_distance.py:42–63  ·  view source on GitHub ↗

Benchmarks

()

Source from the content-addressed store, hash-verified

40if __name__ == "__main__":
41
42 def benchmark() -> None:
43 """
44 Benchmarks
45 """
46 from timeit import timeit
47
48 print("Without Numpy")
49 print(
50 timeit(
51 "euclidean_distance_no_np([1, 2, 3], [4, 5, 6])",
52 number=10000,
53 globals=globals(),
54 )
55 )
56 print("With Numpy")
57 print(
58 timeit(
59 "euclidean_distance([1, 2, 3], [4, 5, 6])",
60 number=10000,
61 globals=globals(),
62 )
63 )
64
65 benchmark()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected