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 & HelpPrograms › fps counter
Page Index Toggle Pages: 1
fps counter (Read 1339 times)
fps counter
Jun 27th, 2005, 3:30am
 
I'm trying to optimise my code, and the first thing I can think of is a fps counter. I guess I could add a frame counter that I could frames++ every frame and reset to 0 every second. But how do I access the time in processing, or how else can I check if a second has passed ?
Re: fps counter
Reply #1 - Jun 27th, 2005, 4:17am
 
In the documentation / reference switch to Complete view, (from Abridged).

Time & Date
day()
hour()
millis()
minute()
month()
second()
year()

You should track the millis() (number of milliseconds since starting an applet) for your frame rate counter thingy...

But normally I just do println(framerate) though. Its a float btw.
Re: fps counter
Reply #2 - Jun 28th, 2005, 7:03pm
 
Oooohh you can print the actual framerate .... Cheesy
Page Index Toggle Pages: 1