3D printer G-code · Marlin and Klipper
G4: Dwell (pause) (Marlin & Klipper)
Dwell (pause) — Waits after all earlier moves are finished. Used in start code, after a filament change, or to let a layer cool.
On this page
| Property | Value |
|---|---|
| Command | G4 |
| Function | Dwell (pause) |
| Firmware | Marlin and Klipper |
| Group | Motion |
| Syntax | G4 P<ms> or G4 S<s> |
What does G4 do?
Waits after all earlier moves are finished. Used in start code, after a filament change, or to let a layer cool.
Parameters
| Parameter | Meaning |
|---|---|
P | Time in milliseconds |
S | Time in seconds (Marlin) |
Example
G1 E-5 F2400 ; retract
G4 P2000 ; wait 2 seconds
G1 E5 F2400Tips from practice
- Klipper supports only P (milliseconds).
- For waiting on a temperature use M109 or M190, not G4.
The command works in Marlin and Klipper. Options can differ: Klipper accepts fewer parameters for some M-codes and ignores codes it does not know with an "Unknown command" error.
Related commands
More motion commands
| Command | Function | Firmware |
|---|---|---|
G1 | Linear move (G0 / G1) | Marlin and Klipper |
G2 | Arc move clockwise (G2 / G3) | Marlin and Klipper |
G28 | Home axes | Marlin and Klipper |
G90 | Absolute positioning (G90 / G91) | Marlin and Klipper |
Test it before you print
Paste your start code or a whole file into the 3D printer simulator. It plans every move, shows the time and finds missing waits, cold extrusion and moves outside the bed.
Open the simulatorFrequently asked questions
What does G4 do on a 3D printer?
G4 is dwell (pause). Waits after all earlier moves are finished. Used in start code, after a filament change, or to let a layer cool.
Does G4 work in Klipper and Marlin?
Yes, both firmwares understand G4.
Was this page helpful?