@@ -500,7 +500,7 @@ def search(
500500 For more information see `FT.SEARCH <https://redis.io/commands/ft.search>`_.
501501 """ # noqa
502502 args , query = self ._mk_query_args (query , query_params = query_params )
503- st = time .time ()
503+ st = time .monotonic ()
504504
505505 options = {}
506506 if get_protocol_version (self .client ) not in ["3" , 3 ]:
@@ -512,7 +512,7 @@ def search(
512512 return res
513513
514514 return self ._parse_results (
515- SEARCH_CMD , res , query = query , duration = (time .time () - st ) * 1000.0
515+ SEARCH_CMD , res , query = query , duration = (time .monotonic () - st ) * 1000.0
516516 )
517517
518518 def explain (
@@ -602,7 +602,7 @@ def profile(
602602 Each parameter has a name and a value.
603603
604604 """
605- st = time .time ()
605+ st = time .monotonic ()
606606 cmd = [PROFILE_CMD , self .index_name , "" ]
607607 if limited :
608608 cmd .append ("LIMITED" )
@@ -621,7 +621,7 @@ def profile(
621621 res = self .execute_command (* cmd )
622622
623623 return self ._parse_results (
624- PROFILE_CMD , res , query = query , duration = (time .time () - st ) * 1000.0
624+ PROFILE_CMD , res , query = query , duration = (time .monotonic () - st ) * 1000.0
625625 )
626626
627627 def spellcheck (self , query , distance = None , include = None , exclude = None ):
@@ -940,7 +940,7 @@ async def search(
940940 For more information see `FT.SEARCH <https://redis.io/commands/ft.search>`_.
941941 """ # noqa
942942 args , query = self ._mk_query_args (query , query_params = query_params )
943- st = time .time ()
943+ st = time .monotonic ()
944944
945945 options = {}
946946 if get_protocol_version (self .client ) not in ["3" , 3 ]:
@@ -952,7 +952,7 @@ async def search(
952952 return res
953953
954954 return self ._parse_results (
955- SEARCH_CMD , res , query = query , duration = (time .time () - st ) * 1000.0
955+ SEARCH_CMD , res , query = query , duration = (time .monotonic () - st ) * 1000.0
956956 )
957957
958958 async def aggregate (
0 commit comments