tox-dev / filelock

A platform-independent file lock for Python.

Home Page:https://py-filelock.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User time.perf_counter instead of time.monotonic?

zpz opened this issue · comments

Please see https://www.webucator.com/article/python-clocks-explained/

time.perf_counter has a resolution 4e-7 sec, whereas time.monotonic has a resolution 0.15 sec.

I noticed at least the unix lock implementation uses monotonic. That could lead to waits longer than needed, and make small values of poll_interval not beneficial (while giving user the illusion that they have fine-grained control).

Maybe use perf_counter instead of monotonic?

Feel free to put in a PR for it.

created a PR