Works great, Runs much colder. Couldn’t have asked for a better code snippit!
Thanks spasi!
[EDIT]
I made a slight modification to it so that it can be called from multiple threads. This is done so I can sync both my game logic thread, and my rendering thread independently:
https://pastebin.com/YqqzYewx
Note that I changed the getTime() method from using LWJGL2’s high precision timer to using Java’s built-in nanotime. I am not sure whether that is okay, but the results feel fine for both of my threads at any rate.
–
I feel like this should be more known to developers who use LWJGL3. There isn’t a built-in solution for synchronizing the timing of a thread with LWJGL3, and that may put off some potential developers who get frusturated with using Thread#sleep()