diff --git a/pymongo/asynchronous/topology.py b/pymongo/asynchronous/topology.py index b315cc33b7..32776bf7b9 100644 --- a/pymongo/asynchronous/topology.py +++ b/pymongo/asynchronous/topology.py @@ -354,7 +354,7 @@ async def _select_servers_loop( operationId=operation_id, topologyDescription=self.description, clientId=self.description._topology_settings._topology_id, - remainingTimeMS=int(end_time - time.monotonic()), + remainingTimeMS=int(1000 * (end_time - time.monotonic())), ) logged_waiting = True diff --git a/pymongo/synchronous/topology.py b/pymongo/synchronous/topology.py index 7df475b4c8..df23bff28c 100644 --- a/pymongo/synchronous/topology.py +++ b/pymongo/synchronous/topology.py @@ -354,7 +354,7 @@ def _select_servers_loop( operationId=operation_id, topologyDescription=self.description, clientId=self.description._topology_settings._topology_id, - remainingTimeMS=int(end_time - time.monotonic()), + remainingTimeMS=int(1000 * (end_time - time.monotonic())), ) logged_waiting = True