
March 28, 2012
2:27 p.m.
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