stdlize the result print
This commit is contained in:
parent
75fd006545
commit
5e8858deb6
|
|
@ -5,7 +5,7 @@
|
||||||
# Created by luckydog on 2022/7/1.
|
# Created by luckydog on 2022/7/1.
|
||||||
# Copyright © 2022年 luckydog. All rights reserved.
|
# Copyright © 2022年 luckydog. All rights reserved.
|
||||||
#
|
#
|
||||||
from ast import main
|
# from ast import main
|
||||||
import io
|
import io
|
||||||
|
|
||||||
from xdbSearcher import XdbSearcher
|
from xdbSearcher import XdbSearcher
|
||||||
|
|
@ -101,7 +101,7 @@ def start_bench(dbFile="", srcFile="", cachePolicy="vectorIndex"):
|
||||||
# close the searcher at last
|
# close the searcher at last
|
||||||
f.close()
|
f.close()
|
||||||
searcher.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:
|
except Exception as err:
|
||||||
print(f"failed to open source text file :{err}")
|
print(f"failed to open source text file :{err}")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ def start_search(dbFile="", cachePolicy="vectorIndex"):
|
||||||
print(error)
|
print(error)
|
||||||
return
|
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
|
# quit
|
||||||
searcher.close()
|
searcher.close()
|
||||||
print("searcher test program exited, thanks for trying")
|
print("searcher test program exited, thanks for trying")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue