We report on the determination of micromagnetic parameters of epilayers of the ferromagnetic semiconductor (Ga,Mn)As, which has easy axis in the sample plane, and (Ga,Mn)(As,P) which has easy axis perpendicular to the sample plane. We use an optical analog of ferromagnetic resonance where the laser-pulse-induced precession of magnetization is measured directly in the time domain. By the analysis of a single set of pump-and-probe magneto-optical data we determined the magnetic anisotropy fields, the spin stiffness and the Gilbert damping constant in these two materials. We show that incorporation of 10% of phosphorus in (Ga,Mn)As with 6% of manganese leads not only to the expected sign change of the perpendicular to plane anisotropy field but also to an increase of the Gilbert damping and to a reduction of the spin stiffness. The observed changes in the micromagnetic parameters upon incorporating P in (Ga,Mn)As are consistent with the reduced hole density, conductivity, and Curie temperature of the (Ga,Mn)(As,P) material. We report that the magnetization precession damping is stronger for the n = 1 spin wave resonance mode than for the n = 0 uniform magnetization precession mode.