Suppose I know that the time taken to complete the cpu and gpu work necessary to present a frame is a total of 2ms (or any duration less than the vsync interval - total time taken. In other words, there is always some known amount of time available after the work is done).
What some games do is start work right away, after vysnc and sleep until vblank to present if possible. In fact, there is a function that lets you do this. But I want the opposite -- I want to know how long I can wait until I have to start working to present the frame (knowing in advance how long that takes. Again, assume I know this).
Is there a mechanism or function that tells me the time until the next vsync interval? I'm working to reduce input latency, and I'd rather not keep re-running the central update() loop up until draw() time if I don't have to.