Re: gettimeofday() & the commpage
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 | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Andrew Gallatin