The rules, dialect by dialect
- Fanuc / Haas: integer
Pis milliseconds.G4 P500= 0.5 s.Xtakes seconds with decimals:G4 X0.5. - LinuxCNC / GRBL:
Pis seconds, decimals welcome.G4 P0.5= 0.5 s.G4 P500= 500 s. Yes, really.
If you want a dwell that means the same thing everywhere, write G4 X0.5, or a
decimal P. A decimal point reads as seconds on every control that accepts it.
What dwells are for
Letting something finish. A spot drill holds at depth for one clean revolution. A boring bar spring-passes.
The spindle reaches speed after M03. Coolant arrives after M08. Half a second here, two seconds there,
and the ones inside hole cycles (G82 P…) repeat on every hole.
They’re all cycle time
A dwell is the machine holding still with the clock running. 200 holes × P0.5 is 100 seconds of pure stillness. Real estimates fold every one in at its programmed length, and read the units by the right dialect first.
The viewer reads your dialect for you
UltraNC looks at the whole file (program headers, parameter style, how the dwells are written) and reads P the way your controller would: milliseconds for Fanuc/Haas-style programs, seconds for LinuxCNC/GRBL-style ones. Every dwell lands on the clock at its true length, playback holds the tool with a countdown, and a per-file note tells you which rule was applied. Try the G04 Dwell Test demo in the viewer and watch the countdowns run.
Common questions
How long is G4 P1000?
Depends on the controller. Fanuc and Haas read integer P as milliseconds: G4 P1000 is one second. LinuxCNC and GRBL read P as seconds: the same line is 1000 seconds, nearly 17 minutes. Same code, a thousand-fold difference. Know your dialect before you trust the number.
What is the difference between G4 P and G4 X?
X is always seconds, with decimals allowed: G4 X0.5 is half a second on every major control. P is the one that splits by dialect: integer milliseconds on Fanuc/Haas, seconds on LinuxCNC/GRBL. When in doubt, X with a decimal is the unambiguous way to write a dwell.
Why do programs use dwells at all?
To let something finish. A spot drill dwells at depth to clean up the cone. A boring bar dwells to spring-pass the bore. A dwell after M03 lets the spindle reach speed. One after M08 lets coolant arrive. Each is small, and a dwell inside a hole cycle repeats on every hole, so they add up.
Do dwells count toward cycle time?
Fully. The machine holds position with the clock running. A 0.5 s dwell on each of 200 holes is 100 seconds of cycle time with zero motion. Any estimate worth quoting from folds every dwell in at its programmed length.
Part of the guide: How to estimate CNC machining time from G-code
Where dwells hide: Non-cutting time: rapids, dwells and tool changes.
Dwells in hole cycles: Peck drilling and cycle time