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.

By cnccode · Updated
On this page
  1. What does G4 do?
  2. Parameters
  3. Example
  4. Tips from practice
  5. Related commands
  6. More motion commands
  7. Frequently asked questions
PropertyValue
CommandG4
FunctionDwell (pause)
FirmwareMarlin and Klipper
GroupMotion
SyntaxG4 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

ParameterMeaning
PTime in milliseconds
STime in seconds (Marlin)

Example

G-code
G1 E-5 F2400 ; retract
G4 P2000     ; wait 2 seconds
G1 E5 F2400

Tips 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.

More motion commands

CommandFunctionFirmware
G1Linear move (G0 / G1)Marlin and Klipper
G2Arc move clockwise (G2 / G3)Marlin and Klipper
G28Home axesMarlin and Klipper
G90Absolute 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 simulator

Frequently 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?