<p>You are correct about needing to specify the dwell value in milliseconds. However, the RepRap Wiki indicates that you need to use the <code>Pn</code> argument, and not just an unadorned number as the argument to the command. To adapt the Wiki's own example, you will need to use:</p>

<pre><code>G4 P30000
</code></pre>

<p>This should cause the firmware to dwell (pause) for 30 seconds.</p>

<p><a href="http://reprap.org/wiki/G-code#G4:_Dwell" rel="nofollow noreferrer">RepRap Wiki: G4: Dwell</a></p>

CC BY-SA 3.0
2017-10-29T01:33:32.047Z
2017-10-29T01:33:32.047Z
Mick
<p>Depending on your G-code flavor you may be able to use <a href="https://reprap.org/wiki/G-code#M109:_Set_Extruder_Temperature_and_Wait" rel="nofollow noreferrer"><code>M109</code></a> (heat and wait) instead. If supported M109 will wait until the target temperature is achieved.</p>

CC BY-SA 4.0
2019-05-23T04:20:21.007Z
2019-05-23T13:47:52.490Z
2019-05-23T13:47:52.490Z
Larry
<p>I am writing some G-code for my DIY 3D printer. From what I understand, <code>G4</code> is dwell and its expressed in milliseconds. So my extruder takes about 30 seconds to heat up. Do I just type </p>

<pre><code>G04 30000
</code></pre>

CC BY-SA 4.0
2019-05-23T07:31:54.677Z
This question suffers from the [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). Mick's answer accurately addresses the titular question, while Larry's actually gives the best solution for your problem? Is there any reason you need to do the waiting based on a fixed period of time (e.g., because your extruder does not have closed-loop temperature feedback)?
Tom van der Zanden
<g-code>
How to express dwell time in G-code
Keith Bybee
# How to express dwell time in G-code

(Asked by: username_0 on 2017-10-29)

I am writing some G-code for my DIY 3D printer. From what I understand, `G4` is dwell and its expressed in milliseconds. So my extruder takes about 30 seconds to heat up. Do I just type

```
G04 30000

```

**Tags:** g-code

> **Comments:**
> **username_1**: This question suffers from the [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). username_2's answer accurately addresses the titular question, while username_3's actually gives the best solution for your problem? Is there any reason you need to do the waiting based on a fixed period of time (e.g., because your extruder does not have closed-loop temperature feedback)?  

---

## 2 answers

### Answer by username_2 on 2017-10-29. Score: 2 | Accepted answer

You are correct about needing to specify the dwell value in milliseconds. However, the RepRap Wiki indicates that you need to use the `Pn` argument, and not just an unadorned number as the argument to the command. To adapt the Wiki's own example, you will need to use:

```
G4 P30000

```

This should cause the firmware to dwell (pause) for 30 seconds.

[RepRap Wiki: G4: Dwell](http://reprap.org/wiki/G-code#G4:_Dwell)


---

### Answer by username_3 on 2019-05-23. Score: 4

Depending on your G-code flavor you may be able to use [`M109`](https://reprap.org/wiki/G-code#M109:_Set_Extruder_Temperature_and_Wait) (heat and wait) instead. If supported M109 will wait until the target temperature is achieved.


---

