The pumping mechanism of a swing in a playground is due to the exchange of angular momentum from the rocking movement of the swinger to the swing oscillation around the point from which the swing is suspended. We describe the rocking events as square pulses of short duration. This choice, together with a simplified mechanical model for the swinger, leads to simple formulae for the amplitude gain of the swing per rocking event. We show that the maximum gain is achieved when there is rocking at the swing return points, which is a usual way of swinging. At these points, for pulses that are short enough, the gain is proportional to the angle rocked and is almost independent of the pulse duration. The results describe reasonably well the gain per pulse measured in a realistic experiment.