<p>Given the Marlin Firmware what is the difference between the following lines of code:</p>

<blockquote>
  <p>G4 S20</p>
</blockquote>

<p>and</p>

<blockquote>
  <p>G4 P2000</p>
</blockquote>

The code
```
G4
```
refers to
dwell
. (From what I'm seeing, it can be written as either
```
G4
```
or
```
G04
```
).
```
P
```
is the length of dwell time, usually in milliseconds. The parameter
```
S
```
seems to be invalid, because the only inputs are
```
X
```
(seconds),
```
P
```
(milliseconds), or
```
U
```
(undefined). If you have
```
S20
```
in your code, it is invalid, whereas
```
P2000
```
will cause all axes to remain unmoving for 2 seconds before moving on.
(Note: Not all machines will accept
```
X
```
or
```
U
```
.)
EDIT:
This answer is specific to
non-specific
g-code, taken from this
Source
, since the OP did not state any specifics about their firmware type or equipment used.