Skip to content

gh-161032: Convert BaseEventLoop._clock_resolution to asyncio.constants.CLOCK_RESOLUTION - #161033

Open
asvetlov wants to merge 2 commits into
python:mainfrom
asvetlov:claude/clock-resolution-constant-1660dc
Open

asvetlov wants to merge 2 commits into
python:mainfrom
asvetlov:claude/clock-resolution-constant-1660dc

Conversation

@asvetlov

@asvetlov asvetlov commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

BaseEventLoop.__init__ queried time.get_clock_info('monotonic').resolution for every loop and stored it in the private _clock_resolution attribute, which only _run_once reads. The value is process-wide and never changes, so compute it once as asyncio.constants.CLOCK_RESOLUTION.

TestLoop no longer overrides the resolution with 1e-9. test_asyncio passes with the real resolution and with a forced Windows-like value of 0.015625 s.

🤖 Generated with Claude Code

…onstants.CLOCK_RESOLUTION

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant