4 ms·
You just need your code to finish before the next frame. Then you wait and start the next cycle when you receive the interrupt from the start of the next frame
by mjul 5y ago
You just need your code to finish before the next frame. Then you wait and start the next cycle when you receive the interrupt from the start of the next frame from your graphics hardware.
Of course once you start writing for heterogeneous hardware like PCs with very different performance between models, you may use adaptive approaches to use all the available resources rather than just providing the most basic experience for everyone.