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 › Suppress graphical output
Page Index Toggle Pages: 1
Suppress graphical output (Read 261 times)
Suppress graphical output
Jun 2nd, 2008, 1:36pm
 
Hello,

Apologies if this question is already answered but I had a little root around and couldn't see an obvious answer.

I'm making a simulation and would like to be able to run it with visual output for display purposes but also to run it at high speed for data generation. Can I switch off all the graphical output to speed this up? Also, will the default framerate keep the simulation tied to 60 "draw()s" per second? How I get it to run as fast as possible?

Cheers – this really is a great tool,
Ed Long
Re: Suppress graphical output
Reply #1 - Jun 2nd, 2008, 2:44pm
 
if you don't have any graphical output, that's about all the speedup you can do (by simply not drawing). to go higher than 60, just set frameRate() arbitrarily high:
http://processing.org/reference/frameRate_.html

but then again, for running a simulation, you'd probably be better off doing the opposite thing:

1. put your simulation code into its own Thread.
2. set frameRate() very low (1 or 10, say), and have it periodically update the screen to show the progress of the simulation.

this way you won't be limited by the drawing setup and the thread can run as quickly as possibly.

(more about threads can be found in other posts here or in hacks.)
Page Index Toggle Pages: 1