MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _monotonic_duration

Function _monotonic_duration

pymongo/asynchronous/monitor.py:57–63  ·  view source on GitHub ↗

Return the duration since the given start time. Accounts for buggy platforms where time.monotonic() is not monotonic. See PYTHON-4600.

(start: float)

Source from the content-addressed store, hash-verified

55
56
57def _monotonic_duration(start: float) -> float:
58 """Return the duration since the given start time.
59
60 Accounts for buggy platforms where time.monotonic() is not monotonic.
61 See PYTHON-4600.
62 """
63 return max(0.0, time.monotonic() - start)
64
65
66class MonitorBase:

Callers 3

_check_serverMethod · 0.70
_check_with_socketMethod · 0.70
_pingMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected