The use of laser–plasma-based x-ray sources is discussed, with a view to carrying out time-resolved x-ray absorption spectroscopy measurements, down to the femtosecond timescale. A review of recent experiments performed by our team is presented. They concern the study of the nonequilibrium transition of metals from solid to the warm dense regime, which imposes specific constraints (the sample being destroyed after each shot). Particular attention is paid to the description of experimental devices and methodologies. Two main types of x-ray sources are compared, respectively, based on the emission of a hot plasma, and on the betatron radiation from relativistic electrons accelerated by laser.