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.
Problem
The animation loop with a sleep time of 1e-3 seconds (1000Hz) paradoxically causes sluggish UI response when moving sliders. The tight loop consumes excessive CPU resources and doesn't allow enough time for processing UI events. Updating at 1000Hz provides no visual benefit but consumes resources
Solution
Increase the sleep time from 1e-3 seconds to 0.016 seconds (approximately 60Hz), which provides a better balance between animation smoothness and UI responsiveness.
Testing
I tested several values between 0.016-0.05 seconds and found that 0.016 provides the best responsiveness animation on my system (WSL) and another device. This change makes slider movements react in real-time while maintaining smooth visual updates.
For comparison: