2016-03-26 00:47:20 +01:00
|
|
|
# Pause
|
|
|
|
|
2016-05-20 22:09:18 +02:00
|
|
|
Pause the program for the number of milliseconds you say.
|
|
|
|
You can use this function to slow your program down.
|
2016-03-26 00:47:20 +01:00
|
|
|
|
|
|
|
```sig
|
|
|
|
basic.pause(400)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Parameters
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2016-05-20 22:09:18 +02:00
|
|
|
* ``ms`` is the number of milliseconds that you want to pause (100 milliseconds = 1/10 second, and 1000 milliseconds = 1 second).
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Example: diagonal line
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2016-05-20 22:09:18 +02:00
|
|
|
This example draws a diagonal line by turning on LED `0, 0` (top left) through LED `4, 4` (bottom right).
|
|
|
|
The program pauses 500 milliseconds after turning on each LED.
|
|
|
|
Without `pause`, the program would run so fast that you would not have time to see each LED turning on.
|
2016-03-26 00:47:20 +01:00
|
|
|
|
|
|
|
```blocks
|
|
|
|
for (let i = 0; i < 5; i++) {
|
|
|
|
led.plot(i, i)
|
|
|
|
basic.pause(500)
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See also
|
2016-03-26 00:47:20 +01:00
|
|
|
|
2016-06-14 23:20:45 +02:00
|
|
|
[while](/blocks/loops/while), [running time](/reference/input/running-time), [for](/blocks/loops/for)
|
2016-03-26 00:47:20 +01:00
|
|
|
|