The semiconductor industry is continuously pushing the limits of photolithography, with feature sizes now smaller than 10 nm. To ensure quality, it has become necessary to look beyond the conventional metrological techniques. X-ray scattering has emerged as a possible contender to determine the average shape of a line grating with subnanometer precision. However, to fulfill its promise, faster algorithms must also be developed to interpret and extract metrics from reciprocal-space scattering data. In this paper, we present a fast and accurate x-ray technique and analysis algorithm: critical-dimension grazing-incidence small-angle x-ray scattering (CD GISAXS). The CD GISAXS technique is used in grazing-incidence configuration with a continuous azimuthal rotation of the sample, and thus does not require high-energy x-rays to penetrate the wafer and greatly reduces the data-acquisition times, permitting analysis within the framework of the distorted-wave Born approximation.