RDTSC reliable for use by clockspeed?
Paul Sheer <[email protected]> Fri, 7 Jan 2011 13:11:55 -0600
| Newsgroups | gmane.comp.lib.libtai |
|---|---|
| Message-ID | <[email protected]> |
Hi there, Various sources now say that RDTSC is no longer a reliable clock for clockspeed due to power-mode adjustments and non-sync on newer multi-core machines. Will this affect clockspeed? On Solaris, according to the man pages, gethrtime() is the same as clock_gettime(CLOCK_MONOTONIC,...) and seems to be based on a hardware clock. On Linux, is clock_gettime(CLOCK_MONOTONIC,...) a good choice? (POSIX says that CLOCK_MONOTONIC is merely monotonic and does not have steps. It does not say it should be based on a hardware clock like the 82C54.) Does anyone know of other OS-specific ops that can be used to get hardware-clock-based timing info that can replace the RDTSC macro in the clockspeed source? Many thanks -paul