Ok I’ll try to explain things a little clearer by showing the code to you and detailing the exact problem.
The problem has started because i had not put Timer.dll in the right place and as a result the AdvancedTimer came out with about 66 ticks per second which was fine for the below code.
private void loop() {
AdvancedTimer timer = new AdvancedTimer();
long sleepTime = timer.getTicksPerSecond() / 60; //60 fps
System.out.println(timer.getTicksPerSecond());
long ticks = 0;
timer.start();
while(engineRunning) {
long time = 1000 / timer.getTicksPerSecond();
kb.update(time);
sound.render();
update(time);
Graphics g = screen.getGraphics();
draw(g);
g.dispose();
screen.show();
timer.sleepUntil(ticks + sleepTime);
ticks += sleepTime;
}
timer.stop();
}
The idea being that the millisecond value it takes to cycle is used to move/animate/process the information.
Now with Timer.dll i get 3579545 ticks per second and so the millisecond value i get is now 0 mainly due to the conversion process, but even fixed it is still too low a value to use as a millisecond value. So, as far as i can see it, i can change my code to take in nano or microsecond timings or find an equation that converts it and determines the best way of making it run at 60fps easily.