In my Opengl "Engine" i have the following method to compute all the time values, i could need in a frame:
public static void computeTime(){
thisFrame = System.nanoTime();
delta = thisFrame - lastFrame;
lastFrame = thisFrame;
deltams = (float) (delta / 1e6);
deltas = (float) (delta / 1e9);
fps = (float) 1e9 / delta;
ticksInSeconds += deltas;
}
Im calling this method at the beginning of every frame. then i use the delta values to compute movement and over things.
Is this a proper way to do this? Or am I missing something in the order of the computations? Because I'm feeling like running applications are kind of lagging a bit... so it cannot be completely right, can it?