Directly use monotonic.monotonic (vs optionally using it)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
- Allow providing a non-standard (eventlet or
|
||||
other condition class) to the r/w lock for
|
||||
cases where it is useful to do so.
|
||||
- Directly use monotonic.monotonic.
|
||||
0.8:
|
||||
- Add fastener logo (from openclipart).
|
||||
- Ensure r/w writer -> reader -> writer
|
||||
|
||||
@@ -17,20 +17,8 @@
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import time
|
||||
|
||||
# Use monotonic time in stopwatches if we can get at it...
|
||||
#
|
||||
# PEP @ https://www.python.org/dev/peps/pep-0418/
|
||||
try:
|
||||
now = time.monotonic
|
||||
except AttributeError:
|
||||
try:
|
||||
# Try to use the pypi module if it's available (optionally...)
|
||||
from monotonic import monotonic as now
|
||||
except (AttributeError, ImportError):
|
||||
# Ok fallback to the non-monotonic one...
|
||||
now = time.time
|
||||
from monotonic import monotonic as now # noqa
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
Reference in New Issue
Block a user