Skip to content

Commit 0e346b2

Browse files
committed
feat: Add timings of each implementation
1 parent ea5b2d0 commit 0e346b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

matrix/count_negative_numbers_in_sorted_matrix.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ def benchmark() -> None:
148148
",count_negatives_brute_force_with_break,generate_large_matrix"
149149
)
150150
for func in (
151-
"count_negatives_binary_search",
152-
"count_negatives_brute_force_with_break",
153-
"count_negatives_brute_force",
151+
"count_negatives_binary_search", # 175.51 seconds
152+
"count_negatives_brute_force_with_break", # 271.04 seconds
153+
"count_negatives_brute_force", # 646.65 seconds
154154
):
155155
time = timeit(f"{func}(generate_large_matrix())", setup=setup, number=5000)
156156
print(f"{func}() took {time} seconds")

0 commit comments

Comments
 (0)