Probably solved: Equivalent to gethrtime()
Probably solved: Equivalent to gethrtime()
- Subject: Probably solved: Equivalent to gethrtime()
- From: Malte Tancred <email@hidden>
- Date: Fri, 7 Dec 2001 10:18:38 +0100
Thank you Brendan, and everyone else for your swift answers.
If mach_absolute_time() is in fact a fixed clock cycle counter this
will solve my problem. I've patched the program I was trying to
compile and it seems works now.
Next I'll have to test the functionallity to assert that it actually
works.
I'll report my findings in a couple of months. The program is keeping
the system clock 'synced' by compensating for a constantly fast or
slow processor clock. I'll have to run the program on a computer for
some time to see if it succeeds in its efforts.
Again, thanks and cheerio,
Malte
Brendan Younger:
On Wednesday, November 28, 2001, at 09:04 AM, Malte Tancred wrote:
Is there a Mac OS X equivalent to the gethrtime() nanosecond counter
found on Solaris?
>From the Mac OS X 10.1 Release Notes:
IMPORTANT:
Processes requiring high resolution processor based timing information
should use the one of the high level abstractions provided by Mac OS X
such as mach_absolute_time or UPTime and should never attempt to access
the hardware directly.
Check out /usr/include/mach/mach_time.h and clock.h in the
Kernel.framework.
Brendan Younger
--
Malte Tancred
Computer programmer, Oops AB, Sweden
mailto:email@hidden
http://www.oops.se/