There is an increasing demand for high-precision gas absorption spectroscopy in basic research and industrial applications, such as gas tracking and leak warning. In this Letter, a novel, to the best of our knowledge, high-precision and real-time gas detection method is proposed. A femtosecond optical frequency comb is used as the light source, and a broadening pulse containing a range of oscillation frequencies is formed after passing through a dispersive element and a Mach-Zehnder interferometer. Four absorption lines of H13C14N gas cells are measured at five different concentrations within a single pulse period. A single scan detection time of only 5 ns is obtained along with a coherence averaging accuracy of 0.0055 nm. High-precision and ultrafast detection of the gas absorption spectrum is accomplished while overcoming complexities related to the acquisition system and light source that are encountered in existing methods.