[Python-Dev] PEP 418: Add monotonic clock
Yury Selivanov
yselivanov.ml at gmail.com
Wed Mar 28 16:27:26 CEST 2012
More information about the Python-Dev mailing list
Wed Mar 28 16:27:26 CEST 2012
- Previous message: [Python-Dev] PEP 418: Add monotonic clock
- Next message: [Python-Dev] PEP 418: Add monotonic clock
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2012-03-28, at 10:17 AM, Nick Coghlan wrote: > def _make_monotic: > try: > # Use underlying system monotonic clock if we can > return _monotonic > except NameError: > _tick = time() > def monotic(): > _new_tick = time() > if _new_tick > _tick: > _tick = _new_tick > return _tick > > monotonic = _make_monotonic() > > Monotonicity of the result is thus ensured, even when using > time.time() as a fallback. What if system time jumps 1 year back? We'll have the same monotonic time returned for this whole year? I don't think we should even try to emulate any of OS-level functionality. - Yury
- Previous message: [Python-Dev] PEP 418: Add monotonic clock
- Next message: [Python-Dev] PEP 418: Add monotonic clock
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list