Messages in this thread | | | Date | Fri, 8 Mar 2002 14:45:27 -0500 (EST) | From | "Richard B. Johnson" <> | Subject | Re: gettimeofday() system call timing curiosity |
| |
On Fri, 8 Mar 2002 johan.adolfsson@axis.com wrote:
> What happens if you remove the printf/puts and simply counts the number > of times the different cases happen? >
Try it. It doesn't matter. Alan was correct, my computer sucks. However, they won't give me a 10 GHz one (yet). Note that although gettimeofday() has 1 microsecond resolution, not all the codes are exercised. We get something with the granularity of 50 to 190 microseconds. This is to be expected. You would need a timer that updates at least twice the expected resolution to be able to exercise all the bits, i.e., something with a 2 MHz update-rate, that could be read before it changed, or a real 'buzzer' of an ISR at 2 MHz. Before everybody argues, a 1 MHz ISR would give you a value that is updated at 1 microsecond intervals, but now we have to read in asynchronously and that's where Shannon (information theory) laws take effect.
> Another thought: Isn't it quite common that clock generators has a mode > where the frequency differs around the desired frequency to spread the > spectrum > and easier pass EMC tests?
Actually, I think they just use a junk piezo-resonator instead of a quartz crystal. If you try spread-spectrum with a bus-clock, you will screw up all the timing so the bus won't work. Think PCI Bus with its 'reflected-wave' mechanism. If the clock timimg was to change during PCI Bus activity, all bets are off.
> Could that be the case with the laptop? > /Johan > Don't think so.
Cheers, Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Bill Gates? Who?
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |