Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unix-porting Digest, Vol 1, Issue 52



I'm trying to obtain cpu usage values, eg 50% system, 10% user, 40% idle figures (from an unprivileged program). I
think the right call is the undocumented host_statistics(.,HOST_CPU_LOAD_INFO,...). It appears to return 4 unsigned integers, probably
corresponding to user, system, idle, nice. By analogy with other unix's, I imagine the percentage values are calculated
by taking the difference between successive values and normalizing the total to 100%.


However, if there's an example of how to use it, that would make my life a lot easier.

Also, it appears that the statistics for multiple (two) cpu's may be mixed together rather than separated (as is done in solaris for instance).
Is this true, or is there some way of obtaining separate statistics for each cpu?


Thanks,
-- danq

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.