Fps

Is there a way to change the fps to 18 for a few frames then go back to 40?

You can do that using setInterval, search the forums, and you’ll find many threads on how to use it.