mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
58 lines
1.1 KiB
XML
58 lines
1.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
<name>delay()</name>
|
|
|
|
<category>Environment</category>
|
|
|
|
<subcategory></subcategory>
|
|
|
|
<usage>Web & Application</usage>
|
|
|
|
<example>
|
|
<image>delay_.jar</image>
|
|
<code>
|
|
int pos = 0;
|
|
void loop() {
|
|
background(204);
|
|
pos++;
|
|
line(pos, 20, pos, 80);
|
|
if(pos > width) {
|
|
pos = 0;
|
|
}
|
|
delay(250); // Stops the program for 250 milliseconds
|
|
}
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Forces the program to stop running for a specified time. Delay times are specified in thousandths of a second. The function call <b>delay(3000)</b> 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 loop() for the first time, it will complete the loop before stopping.
|
|
</description>
|
|
|
|
<syntax>
|
|
delay(<c>milliseconds</c>)
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>milliseconds</label>
|
|
<description>int: specified as milliseconds (there are 1000 milliseconds in 1 second)</description>
|
|
</parameter>
|
|
|
|
<returns>None</returns>
|
|
|
|
<related></related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Function</type>
|
|
|
|
<partof>Core</partof>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</root>
|