In ToF mass spectrometry, ions are accelerated by an electric field and travel through a flight tube. The time it takes for an ion to reach the detector is measured; this time is dependent on the ion's mass-to-charge ratio. Lighter ions reach the detector faster than heavier ones, allowing for the separation and identification of different species.