Re: Clock monotonic a suggestion

Joel Becker
2003-03-21T19:54:10Z

On Fri, Mar 21, 2003 at 02:17:44PM +0100, Martin Waitz wrote:
> why don't you simply use asm("rdtsc") ?
> (ok, you should make sure that you always ask the same processor and
> stuff, but using the built in TSC seems to do everything you want...)

It does. That's the point. monotonic_clock() is intended as a
portable and consistent wrapper around such access. Otherwise, any
module that needs such access must do system specific work (TSC on x86,
cyclone on x86-x440, other stuff on S/390, etc). In addition, having
speedstep handling in one place is a good thing.

Joel

--

Life's Little Instruction Book #335

"Every so often, push your luck."

Joel Becker
Senior Member of Technical Staff
Oracle Corporation
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127