FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

delay()

   
Examples  
int pos = 0; 
void draw() { 
  background(204); 
  pos++; 
  line(pos, 20, pos, 80); 
  if(pos > width) { 
    pos = 0; 
  } 
  delay(250);  // Stops the program for 250 milliseconds 
} 

Description   Forces the program to stop running for a specified time. Delay times are specified in thousandths of a second. The function call delay(3000) will stop the program for three seconds. This function causes the program to stop as soon as it is called, except if the program is running the draw() for the first time, it will complete the loop before stopping.
   
Syntax  
delay(milliseconds)
   
Parameters  
milliseconds   int: specified as milliseconds (there are 1000 milliseconds in 1 second)

   
Returns   None
   
Usage   Web & Application
   
 
 






   
 
Updated: Fri Jul 15 16:35:37 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info