It looks like the value comes from gPEClockFrequencyInfo.cpu_frequency_hz. Is the value returned by clock_get_uptime() related with gPEClockFrequencyInfo.cpu_frequency_hz? For example if I want to measure 20 secs in terms of CPU cycles then can I say clock_get_uptime(current_time) reuired_time = current_time + 20 * gPEClockFrequencyInfo.cpu_frequency_hz; Will current_time be greater than or equal to required time after 20 sec? Thanks Lalit. -----Original Message----- From: darwin-kernel-admin@lists.apple.com [mailto:darwin-kernel-admin@lists.apple.com]On Behalf Of Paul Ripke Sent: Sunday, July 25, 2004 6:02 PM To: Lalit Chandivade Cc: darwin-kernel@lists.apple.com Subject: Re: How to get CPU cycles per sec? On Sunday, Jul 25, 2004, at 00:08 Australia/Sydney, Lalit Chandivade wrote:
Hi
As per the following discussion
gettingsystemperfo
rmance.001.txt
clock_get_uptime gives system up time in CPU cycles.
Is there a way in kernel or IOKit to know the CPU cycles per second?
A little digging through xnu source should show where this is coming from: pbg3:ksh$ sysctl hw.cpufrequency hw.cpufrequency = 300000000 Cheers, -- Paul Ripke Unix/OpenVMS/TSM/DBA I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams _______________________________________________ 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. _______________________________________________ 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)
-
Lalit Chandivade