>Edit: If you just have clock output in ticks, you also need enought time to elapse to get a deviation of at least one tick between both bot clocks you are comparing. This is a big limitation, because at a clock rate of 1GHz you are still waiting for like 30 years (!!). (In practice you could probably cheat a bit to get around this limit)
In practice with this level of precision you are usually measuring the relative phase of the two clocks, which allows substantially greater resolution than just looking at whole cycles, which is 'cheating' to some degree, I guess. (The limit is usually how noisy your phase measurement is)
(To give some intuition, imaging comparing two pendulum clocks. I think you can probably see how if you take a series of pictures of the pendulums next to each other you could gauge whether one of them is running fast relative to the other, and by how much, without one completing one full swing more than the other)
In practice with this level of precision you are usually measuring the relative phase of the two clocks, which allows substantially greater resolution than just looking at whole cycles, which is 'cheating' to some degree, I guess. (The limit is usually how noisy your phase measurement is)
(To give some intuition, imaging comparing two pendulum clocks. I think you can probably see how if you take a series of pictures of the pendulums next to each other you could gauge whether one of them is running fast relative to the other, and by how much, without one completing one full swing more than the other)