Is it worth using request animation frame if I am forcing it to go on 25 FPS. This is why I am asking:
Normal RAF behaviour:
a1000ms / 60 fps = 16.66a
That is a standard refresh rate of most monitors.
Dropping FPS to 30 :
1000 / 30 = 33.33
that is exactly half of 60 and that means that every other RAF execution will do something which is logical and consistent
Dropping FPS to 25 :
1000 / 25 = 40
this is not dividable by 16.66(usual RAF time for screen update)
With this logic, i would have to draw every 40 ms something to the screen, but that is not possible cause one frame is 16.66.
I am lowering the frame count by standard code:
fps = 25,
renderRate = 1000 / fps,
function animation(timestamp) {
draw.requestAnimationFrame = requestAnimationFrame(animation);
now = timestamp;
elapsed = now - then;
if (elapsed > renderRate) {
then = now - (elapsed % renderRate);
//Some code for execution goes here
}
}