Skip to content

Commit a6c7c27

Browse files
committed
delay.xml added with documentation based on its java equivalent
* very simple example provided, could use work
1 parent 6dcbeb5 commit a6c7c27

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Reference/api_en/delay.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<root>
3+
<name>delay()</name>
4+
5+
<category>Environment</category>
6+
7+
<subcategory></subcategory>
8+
9+
<example>
10+
<noimage />
11+
<code><![CDATA[
12+
def draw():
13+
line(random(100), random(100), random(100), random(100))
14+
delay(1000)
15+
]]></code>
16+
</example>
17+
18+
<description><![CDATA[
19+
The delay() function halts for a specified time. Delay times are specified in thousandths of a second. For example, running delay(3000) will stop the program for three seconds and delay(500) will stop the program for a half-second.<br />
20+
<br />
21+
The screen only updates when the end of draw() is reached, so delay() cannot be used to slow down drawing. For instance, you cannot use delay() to control the timing of an animation.
22+
]]></description>
23+
24+
<syntax>
25+
delay(<c>time</c>)
26+
</syntax>
27+
28+
<parameter>
29+
<label>time</label>
30+
<description><![CDATA[int: milliseconds to pause before running draw() again]]></description>
31+
</parameter>
32+
33+
<related>frameRate_var</related>
34+
<related>draw</related>
35+
36+
</root>

0 commit comments

Comments
 (0)