Skip to content

Switching from time to monotonic #4528

@jakirkham

Description

@jakirkham

Currently we use time (see below), but this can be problematic. For example @pentschev and @quasiben recently tracked down an issue where system time could be off by as much as 2s (including going backwards! 👨‍🔬). It would be good to start using monotonic to avoid these issues.

# A high-resolution wall clock timer measuring the seconds since Unix epoch
if sys.platform.startswith("win"):
time = _WindowsTime().time
else:
# Under modern Unices, time.time() should be good enough
time = timemod.time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions