Let's say I have a computer running at 4 GHz.

I would say it means I need a way to measure increments of time of about 0.25 ns.

How does a computer do that? My question is both:

* Technological: what is the "physical" technology of the raw sensor (is it quartz? What are its defining characteristics ?)
* Practical: based on this raw sensor, what methods are put in place to actually be able to measure such a small increment of time somewhat correctly? E.g. if you tell me the clock uses a quartz whose frequency is about 32768 Hz, how do you use that to measure a 0.25ns increment? Do you amplify the quartz signal so massively that you can actually measure a 0.001% variation of amplitude in the resulting signal? in which case, what about noise in the amplification procedure?