The Gaerttner Laboratory electron linear accelerator at Rensselaer Polytechnic Institute was used in the measurement of the neutron total cross section of natural beryllium and carbon (graphite) in the energy range of 0.4 to 20 MeV. Neutron transmission measurements were made using the time-of-flight method with a 100-m flight path, fast detector response and electronics, and a narrow neutron pulse width to provide good energy resolution. A method was developed to determine the time-dependent background component associated with the transmission measurement using a combination of experimental data and Monte Carlo methods. The signal-to-background ratio combined with low counting statistics error resulted in low uncertainties and highly accurate data. The graphite measurement, showing excellent agreement with the current evaluations, provided a verification of the accuracy in the measurement and analytical methods used. The measurements of beryllium resulted in an accurate measurement of total cross section, showing some deviations with commonly used evaluations and better agreement with ENDF/B-VI.8. These results can be used for the improvement of future neutron cross-section evaluations of beryllium.