Skip to content

Commit c42a822

Browse files
committed
clock() gives CPU time, which is incorrect here.
1 parent eb0cc9d commit c42a822

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

neo4j/v1/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from collections import deque
2323
from random import random
2424
from threading import RLock
25-
from time import clock, sleep
25+
from time import time, sleep
2626
from warnings import warn
2727

2828
from neo4j.bolt import ProtocolError, ServiceUnavailable
@@ -425,7 +425,7 @@ def _run_transaction(self, access_mode, unit_of_work, *args, **kwargs):
425425
RETRY_DELAY_MULTIPLIER,
426426
RETRY_DELAY_JITTER_FACTOR)
427427
last_error = None
428-
t0 = t1 = clock()
428+
t0 = t1 = time()
429429
while t1 - t0 <= self._max_retry_time:
430430
try:
431431
self._create_transaction()
@@ -436,7 +436,7 @@ def _run_transaction(self, access_mode, unit_of_work, *args, **kwargs):
436436
except (ServiceUnavailable, SessionExpired) as error:
437437
last_error = error
438438
sleep(next(retry_delay))
439-
t1 = clock()
439+
t1 = time()
440440
raise last_error
441441

442442
def read_transaction(self, unit_of_work, *args, **kwargs):

0 commit comments

Comments
 (0)