The study gets a closed form of the phase-response of a waveguide Bragg grating (WBG) by solving its coupled-mode equation with the Fourier transform (FT) of its index perturbation and the law of flux conservation, and then establishes the semi-analytic general solution of its delay spectrum by differentiating the phase response. Based on this delay general solution, the delay spectra of uniform and linearly-chirped WBGs are simulated, which are compared with those delay spectra obtained by other methods and the measured spectra in order to verify the analysis precision and efficiency of delay general solution. The comparison results show that the delay spectra calculated with this general solution agree well with those measured or calculated by other methods in the whole reflection band. Moreover, this general solution can be employed for the fast and exact analysis of arbitrarily complicated delay spectra of WBGs. The WBGs with analytic FT and discrete FT possess the linear complexities of O(N), and O(Nlb N)(N is the number of calculation points), respectively. This method may provide a universal basic theory and an analytic method for the analysis, design, and application of the delay properties and phases of WBGs.