Repository navigation
Document the MSVC timer resolution caveat of Tree::sleep - #1257
Merged
Merged
Conversation
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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #1134.
On MSVC,
std::condition_variable::wait_forrounds short waits up to the system timer resolution (~15.6 ms by default, microsoft/STL#2173), soTree::sleep/tickWhileRunningsleep longer than requested. This adds a doc note with the usual workaround (timeBeginPeriod(1)). Doc only.🤖 Generated with Claude Code