The abnormalities you encounter can be caused by many factors, including an OS scheduler that starts and gives the CPU to another process or similar problems. In fact, a normal person will not tell the difference between the rendering time of 1 and 2 ms. Moving images work at a speed of 25 frames per second, which means that each frame is displayed for about 40 ms and it looks fluid to the human eye.
As for stuttering animations, you should learn how to maintain a constant animation speed. The most common approach I've seen looks something like this:
while(loop) { lastFrameTime; // time it took for last frame to render timeSinceLastUpdate+= lastFrameTime; if(timeSinceLastUpdate > (1 second / DESIRED_UPDATES_PER_SECOND)) { updateAnimation(timeSinceLastUpdate); timeSinceLastUpdate = 0; } // do the drawing presentScene(); }
Or you can just pass lastFrameTime to update. Animate each frame and interpolate between animation states. The result will be even more fluid.
If you're already using something like the above, maybe you should look for the culprits in other parts of the rendering cycle. In Direct3D, expensive things were calls to draw primitives and change display states, so you can check their OpenGL counterparts.
source share