Re: Including kern clock.h from a non-kext application
Re: Including kern clock.h from a non-kext application
- Subject: Re: Including kern clock.h from a non-kext application
- From: André Berg <email@hidden>
- Date: Fri, 10 Oct 2008 00:58:47 +0200
Hi,
Thanks for replying. I already include those in my example code. Normally I
only include files when I know what they are there for.
Do you know why they are not supposed to be callable any longer from
userland apps?
In my searches I found some old mailing list messages (around 2001)
mentioning those functions for game timings. That together with the Kernel
Programming Guide also mentioning those functions brought me on this track.
I am just trying to find a relatively save and easy way to do
high-resolution performance counting on Intel/PPC archs, preferably using
system provided functions which already cover a larger armount of
hardware/software configurations.
So, far I know about UpTime (Unfortunately, there might be times where I
can't link to CoreServices), RDTSC in all it's flavors, and mach_absolute_time.
I guess I will combine mach_absolute_time with AbsoluteToNanoseconds or
fiddle with with mach_timebase_info
Again, thanks for your help!
André
--- Original Nachricht ---
Absender: Herb Petschauer
Datum: 09.10.2008 22:45 Uhr
2008/10/9 André Berg <email@hidden>:
Hi,
So what's the secret to be able to include
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/kern/clock.h
?
{Snip}
Err... you don't. Are you writing a kernel extension? No? Then
stick to the userland frameworks :-)
Try:
#include <mach/mach.h>
#include <mach/mach_time.h>
That will give you mach_absolute_time() (search the archives).
UpTime() is also an option (search the archives).
Good luck.
Cheers,
-H.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden