Pulsars are neutron stars which produce stellar pulses at a uniform time rate.
A neutron star has a magnetic field which rotates with the star. Electrically charged particles which are affected by the rotating magnetic field accumulate in bunches, producing a burst of electromagnetic energy for every regular sweep of the star.
Neutron stars rotate about their axes with oscillating periods ranging from milliseconds to several seconds, depending on the size and density of the star.
In the case of some pulsars, the interval between pulses is so regular that the stars function as celestial clocks, marking time as precisely and reliably as the most accurate atomic clocks. Other pulsars are not so constant, speeding up and slowing down at irregular intervals.
The fastest and most accurate pulsar observed from a terrestrial telescope rotates at 642 times per second. Over the course of a year, the signal drifts only about a millionth of a second, which is comparable to the most reliable atomic clocks.
The arrival times of pulsar signals received on the Earth are corrected according to Barycentric Dynamical Time, the time at the gravitational center of mass of the solar system. The signals are then measured against the International Atomic Time standard.
In addition to pulsars, x-ray stars generate stellar pulses at an extremely regular rate, with oscillating periods ranging from milliseconds to several seconds, depending on the size and density of the star.