VanguardEngine icon indicating copy to clipboard operation
VanguardEngine copied to clipboard

Increased timer precision

Open adepke opened this issue 4 years ago • 1 comments

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 avatar Oct 31 '21 20:10 adepke

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

adepke avatar Mar 13 '22 22:03 adepke