Problem with frameRate


#1

Hi i am making a game where the framerate has to be 60. However when i write
frameRate(60); in void setup and
println(frameCount) in draw it seems the frameCount is around 20. It Would be nice to know if there’s anything i can do to change this


#2

Yeah - remove your call to println(). It’s pretty slow, and doesn’t like being called every frame.


#3

That doesn’t seem to be the problem. I am using delay in void draw and it effects the frameRate. how can i set the framerate to 60 while still using the delay?


#4

Wait. Hold on. You have calls to delay() in your code?

Yeah, remove those too. Normally I would post a rant about how awful delay() is. Basically it is not the function you want at all. Look up millis() instead.


#5

thank you for the help