From db95055a56b37cc90526974f7b874da3ce3aafda Mon Sep 17 00:00:00 2001 From: lionsoul2014 Date: Sun, 2 Nov 2025 21:43:54 +0800 Subject: [PATCH] =?UTF-8?q?=CE=BCs=20for=20elapsed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- binding/python/bench_test.py | 4 ++-- binding/python/search_test.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/binding/python/bench_test.py b/binding/python/bench_test.py index 9542a1f..22abca6 100644 --- a/binding/python/bench_test.py +++ b/binding/python/bench_test.py @@ -96,8 +96,8 @@ def run_bench_test(db_path: str, src_path: str, cache_policy: str): return # print the stats info - each_ms = total_secs * 1000 / count - print(f"Bench finished, {{cachePolicy: {cache_policy}, total: {count}, took: {total_secs:.3f} s, cost: {each_ms:.3f} ms/op}}"); + each_us = total_secs * 1000_000 / count + print(f"Bench finished, {{cachePolicy: {cache_policy}, total: {count}, took: {total_secs:.3f} s, cost: {each_us:.0f} μs/op}}"); # resource cleanup searcher.close() diff --git a/binding/python/search_test.py b/binding/python/search_test.py index 56dc5b6..650780c 100644 --- a/binding/python/search_test.py +++ b/binding/python/search_test.py @@ -82,8 +82,8 @@ type 'quit' to exit'''.format(db_path, searcher.get_ip_version().name, cache_pol print("failed to search({}): {}".format(util.ip_to_string(ip_bytes), str(e))) continue - took = (time.time() - s_time) * 1000 - print(f"{{region: {region}, ioCount: {searcher.get_io_count()}, took: {took:.3f} ms}}"); + took = (time.time() - s_time) * 1000_000 + print(f"{{region: {region}, ioCount: {searcher.get_io_count()}, took: {took:.0f} μs}}"); # close the searcher searcher.close()