Time-discretized extreme and vacuum ultraviolet spectroscopy of spark discharges in air, N2 and O2