Figure demonstrates how stopwatch counters can be implemented using the RDTSC instruction on a Pentium for timestamps. See also Appendix for the actual stopwatch code used for the clever compiler implementation.
Figure: test-rdtsc.c: using the RDTSC time stamp instruction.