We report the first measurements of x-ray single-pulse duration and two-pulse separation at the Linac Coherent Light Source using a cross-correlation technique involving x rays and electrons. An emittance-spoiling foil is adopted as a very simple and effective method to control the output x-ray pulse. A minimum pulse duration of about 3 fs full width at half maximum has been measured together with a controllable pulse separation (delay) between two pulses. This technique provides critical temporal diagnostics for x-ray experiments such as x-ray pump-probe studies.