Hands up who could see this coming

After being advised to use the sync and sync2 methods rather than rely on vsync, I thought I'd try and test them out. Not sure if I'm doing this right but here's how I'm using the method, using the mainloop from FullScreenWindowedTest as an example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| private void mainLoop() { while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) { if (Display.isVisible()) { processKeyboard(); logic(); render(); } else { if (Display.isDirty()) { render(); } try { Thread.sleep(100); } catch (InterruptedException inte) { } } Display.sync(60); Display.update(); } } |
As I said I'm not sure if this is the right way to use the method, but doing it this way the updates are not very reliable, the screen seems to skip every few seconds as if it's catching up with the updates, if that makes any sense.
So what I'm I doing wrong here?
cheers
Btw, the display mode is set to 60htz.