Re: gettimeofday() & the commpage
Re: gettimeofday() & the commpage
- Subject: Re: gettimeofday() & the commpage
- From: Andrew Gallatin <email@hidden>
- Date: Fri, 30 Jul 2004 16:56:01 -0400 (EDT)
Ed Wynne writes:
>
>
On Jul 30, 2004, at 4:16 PM, Andrew Gallatin wrote:
>
>
> So.. how the heck do you do it? Is the actual clock hardware mapped
>
> out to userspace? Or is there a trick I'm missing.
>
>
It uses the PowerPC timebase registers which are accessible from
>
userland. They count some multiple of the external bus frequency, as
>
long as you know the conversation factor, its somewhat trivial (and
>
very fast) to convert to wall clock time units.
Ah! That was the trick I was missing. Very cool.
Thanks,
Drew
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.