On Thursday 21 April 2005 16.28, Lee Revell wrote:
[...]
Yes, Linux implements gettimeofday via rdtsc() on x86.
...except on some x86 clones that don't have a working RDTSC
implementation. Generally, all Pentium compatibles and higher should
have it, but some don't.
Also, RDTSC is essentially useless on some early systems with core
clock throttling. Finally, RDTSC sometimes means trouble on SMP
systems, where the TSCs are not guaranteed to be synchronized. AFAIK,
both of these issues have been dealt with in current generation CPUs
and chipsets, but it might be a good idea to check...
Which is why if you
can get away with just using rdtsc directly for timing it's better
than gettimeofday.
Yeah. It's probably ok to just assume it's there if you're dealing
with P3 generation intels and alternatives, but for maximum x86
portability (non-intel CPUs and pre-Pentium CPUs), and portability
beyond x86, one needs a fallback.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,... |
`----------------------------------->
http://audiality.org -'
---
http://olofson.net ---
http://www.reologica.se ---