rpc/client.py: replace use process_time() instead of time()

time.clock() was depreceted since Python 3.3 and was finally
removed in Python 3.8.
https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I3ffe372b61c8afc0ddbbee0064b95059fa184616
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1369
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Karol Latecki 2020-03-19 08:47:39 +01:00 committed by Tomasz Zawadzki
parent fdba47584a
commit 051a6902d8

View File

@ -120,11 +120,11 @@ class JSONRPCClient(object):
return None
def recv(self):
start_time = time.clock()
start_time = time.process_time()
response = self.decode_one_response()
while not response:
try:
timeout = self.timeout - (time.clock() - start_time)
timeout = self.timeout - (time.process_time() - start_time)
self.sock.settimeout(timeout)
newdata = self.sock.recv(4096)
if not newdata: