diff options
| author | Przemysław Suliga <1270737+suligap@users.noreply.github.com> | 2019-05-08 18:34:22 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-05-08 18:34:22 +0200 |
| commit | af5ec222ccd24e81f9fec6c34836a4e503e7ccf7 (patch) | |
| tree | 54ecdd721ed1c66be166bd93f870cca182e0cac3 /tests/test_utils | |
| parent | 30dd43884e8e5dfb3dfd7e31fc78fd569f15916a (diff) | |
Used time.monotonic() instead of time.time() where applicable.
time.monotonic() available from Python 3.3:
- Nicely communicates a narrow intent of "get a local system monotonic
clock time" instead of possible "get a not necessarily accurate Unix
time stamp because it needs to be communicated to outside of this
process/machine" when time.time() is used.
- Its result isn't affected by the system clock updates.
There are two classes of time.time() uses changed to time.monotonic()
by this change:
- measuring time taken to run some code.
- setting and checking a "close_at" threshold for for persistent db
connections (django/db/backends/base/base.py).
Diffstat (limited to 'tests/test_utils')
0 files changed, 0 insertions, 0 deletions
