how does gettimeofday works ?
I mean ,it reads a register or read some file written by the o.s. with the time ?
the o.s. what register read of the processor ? (IA32)
[linux-2.4 running on the modern x86] - it reads the TSC (time stamp counter) the counter that increments each CPU clock. You can look at "arch/i386/kernel/time.c" file for details, see do_gettimeofday() and do_fast_gettimeoffset() functions. If "/proc/cpuinfo" shows "tsc" field in flags - your CPU has TSC support.