We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Maximum Frame rate
Page Index Toggle Pages: 1
Maximum Frame rate (Read 737 times)
Maximum Frame rate
Sep 3rd, 2009, 12:06pm
 
Hi,

I am relatively new to Processing. I have a question about frame rates. I want to run something at very high frame rates if possible. Assuming a digital interface to a high speed LCD display what sort of frame rates are attainable (100? 200 ) ?

thanks !
Re: Maximum Frame rate
Reply #1 - Sep 4th, 2009, 12:12pm
 
Depends on the hardware.

Processing will try to give you as many frames as possible( 60 by default). I just did a sketch with frameRate(2000)... I don't expect the frameRate to actually be 2000 Smiley but I was testing out how many fps I could get from a movie and by setting the sketch frameRate that high I knew it would just go as high as it could.

I'm not a 100% on the code I wrote for this test as it was just to give me a hint of the speed, but I used millis() to measure how many frames actually was processed. I ended up around 210, with a webcam running at the same time that is. So frames above that should be possible.

The problem is probably timing, if your digital interface uses a clock, that can be hard as Processing will vary in speed depending on what the computer is doing and how calculation intensive your draw() method is. If you are "lucky" the LCD will raise some bit/flag when it is ready to read in more bytes.

Processing' frames are "just" a clever way of telling the underlying code to execute the draw function at a specific rate. This is guessing: but it probably goes a bit like, you tell processing to run at a frameRate of 100, underneath a java function calculates that this is 1000 milliseconds / 100 = 10 milliseconds pr frame, so each time 10 milliseconds has passed, run the draw function again.

With that in mind I would guess the maximum frame rate to be around 1000 fps.
Page Index Toggle Pages: 1