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
@@ -38,10 +38,10 @@ def bench(f, *args):
for i in range(10):
f(*args)
s = time.time()
s = time.perf_counter()
for i in range(100):
f(*args)
e = time.time()
e = time.perf_counter()
return e - s
+2 -2
View File
@@ -37,10 +37,10 @@ def bench(f, *args):
for i in range(10):
f(*args)
s = time.time()
s = time.perf_counter()
for i in range(100):
f(*args)
e = time.time()
e = time.perf_counter()
return e - s