We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I want to know how fast my sketch is running (to do some optimization of the code).
I know you can set the frame rate, but if you don't set it and you run a (computational heavy) sketch, the frame rate goes down. Is there a way to know the frame rate?
Another way I thought of checking the speed of my simulation is to add a value every time draw() is used and divide this value with second(). This gives the number of draws/second but it fluctuates to much.
Is there another/better way to check the "speed" of a sketch?
Thanks
Answers
println(frameRate);
use P3D in size();
As well as
framerate()
to set the frame rate, there's a global variableframerate
which should do what you want. See the reference here.(edit: too slow)
frameRate() controlles the framerate (means it can slow down it) but it cannot push/force the program to run at high frameRate. Once I had faced the same problem and disscussed here
OK thanks,
Should have tried
println(frameRate);
before asking this question :)@blyk: Yes, that's important to bear in mind. You shouldn't have to use P3D in size(), though — it should work with any renderer.