refactor: use time.perf_counter for consistent and accurate benchmarking (#2943)

This commit is contained in:
Satyam singh
2025-12-28 06:16:13 -08:00
committed by GitHub
parent 26dfe4f651
commit d9b950eb2f
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -777,11 +777,11 @@ with the naive :meth:`simple_axpby` we first defined.
mx.eval(z)
# Timed run
s = time.time()
s = time.perf_counter()
for i in range(100):
z = f(x, y, alpha, beta)
mx.eval(z)
e = time.time()
e = time.perf_counter()
return 1000 * (e - s) / 100
simple_time = bench(simple_axpby)