stdlize the result print

This commit is contained in:
Lion 2022-07-12 10:40:17 +08:00
parent a27bc6abe9
commit 88462e9983
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@
# Created by luckydog on 2022/7/1.
# Copyright © 2022年 luckydog. All rights reserved.
#
from ast import main
# from ast import main
import io
from xdbSearcher import XdbSearcher
@ -101,7 +101,7 @@ def start_bench(dbFile="", srcFile="", cachePolicy="vectorIndex"):
# close the searcher at last
f.close()
searcher.close()
print(f"Bench finished, [cachePolicy: {cachePolicy}, total: {count}, took: {round(time.time() - sTime, 2)} s, cost: {round(costs/count*1000, 4)} ms/op]")
print(f"Bench finished, {{cachePolicy: {cachePolicy}, total: {count}, took: {round(time.time() - sTime, 2)} s, cost: {round(costs/count*1000, 4)} ms/op}}")
except Exception as err:
print(f"failed to open source text file :{err}")
return

View File

@ -77,7 +77,7 @@ def start_search(dbFile="", cachePolicy="vectorIndex"):
print(error)
return
print(f"region :{region_str} , took {round((time.time()-start)*1000.00, 4)} ms")
print(f"{{region: {region_str} , took: {round((time.time()-start)*1000.00, 4)} ms}}")
# quit
searcher.close()
print("searcher test program exited, thanks for trying")