Simultaneous X-ray and ultraviolet spectroscopy of the Seyfert galaxy NGC 5548.III. X-ray time variability