Within Mach4 two very special commands (which do not have any noticable delay) have been added to switch lasers (and other fast acting devices). These commands switch an Output# of your choice which you have mapped to an output pin number (to provide the actual signal output).
The Mach4 command M62P1 will switch on Output#1 and the command M63P1 will switch off Output#1. Both of these commands need to be followed by an axis (any axis) movement (because activation only occurs at the instant of initial axis movement).
There are other methods and the following short video was made (before the M62/M63 commands had been written into Mach4) using the A axis direction pin for laser switching. My Gcode included the command A0.01 to turn the laser on and A0.00 to turn the laser off. My laser output power was varied between cutting and engraving toolpaths using the spindle speed S### commands.
https://youtu.be/8fUg6ebWut0Tweakie.