Re: Including kern clock.h from a non-kext application
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914) Hi, Again, thanks for your help! André --- Original Nachricht --- Absender: Herb Petschauer Datum: 09.10.2008 22:45 Uhr 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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 2008/10/9 André Berg <andre.berg@email.de>: This email sent to site_archiver@lists.apple.com
participants (1)
-
André Berg