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()