We determined the pulse duration of x-ray free electron laser light at 10 keV 
using highly resolved single-shot spectra, combined with an x-ray free electron 
laser simulation. Spectral profiles, which were measured with a spectrometer 
composed of an ultraprecisely figured elliptical mirror and an analyzer flat 
crystal of silicon (555), changed markedly when we varied the compression 
strength of the electron bunch. The analysis showed that the pulse durations 
were reduced from 31 to 4.5 fs for the strongest compression condition. The 
method, which is readily applicable to evaluate shorter pulse durations, 
provides a firm basis for the development of femtosecond to attosecond sciences 
in the x-ray region.