Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increased timer precision #53

Open
adepke opened this issue Oct 31, 2021 · 1 comment
Open

Increased timer precision #53

adepke opened this issue Oct 31, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@adepke
Copy link
Owner

adepke commented Oct 31, 2021

When waiting for a frame deadline, just sleeping until the objective is varyingly imprecise. A better solution is to modify the timer resolution, sleep until some small unit of time before the deadline, and then spin wait for the remaining time segment. This will significantly reduce frame time variations.

@adepke adepke added the enhancement New feature or request label Oct 31, 2021
@adepke
Copy link
Owner Author

adepke commented Mar 13, 2022

Maybe new win32 api, CreateWaitableTimer with CREATE_WAITABLE_TIMER_HIGH_RESOLUTION? Reportedly 500us precision. Reference: https://discord.com/channels/590611987420020747/590965902564917258/952643195580317747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant