Skip to content

Document the MSVC timer resolution caveat of Tree::sleep - #1257

Merged
facontidavide merged 1 commit into
masterfrom
docs/msvc-tree-sleep
Oct 24, 2026
Merged

facontidavide merged 1 commit into
masterfrom
docs/msvc-tree-sleep

Conversation

@facontidavide

Copy link
Copy Markdown
Collaborator

Closes #1134.

On MSVC, std::condition_variable::wait_for rounds short waits up to the system timer resolution (~15.6 ms by default, microsoft/STL#2173), so Tree::sleep / tickWhileRunning sleep longer than requested. This adds a doc note with the usual workaround (timeBeginPeriod(1)). Doc only.

🤖 Generated with Claude Code

Tree::sleep() waits on a std::condition_variable. On MSVC the wait_for()
timeout is rounded up to the system timer resolution (about 15.6 ms,
microsoft/STL#2173), so a 1 ms sleep can take ~16 ms and
tickWhileRunning() cannot run much faster than 64 Hz on Windows.

Add a note to the Tree::sleep() documentation, with the workaround from
the STL issue thread (timeBeginPeriod(1)) that needs no library change.

Fixes #1134

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@facontidavide
facontidavide merged commit a72d63a into master Oct 24, 2026
16 checks passed
@facontidavide
facontidavide deleted the docs/msvc-tree-sleep branch October 24, 2026 15:01
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WakeUpSignal::waitFor times extended due to MSVC

1 participant