Re: Determining if a user's comp has 2 processors
Re: Determining if a user's comp has 2 processors
- Subject: Re: Determining if a user's comp has 2 processors
- From: Shaun Wexler <email@hidden>
- Date: Sat, 8 Mar 2003 12:44:46 -0800
On Saturday, March 8, 2003, at 01:09 AM, Simone Manganelli wrote:
What's the best way to quickly figure out if the user's computer has 2
processors or not? Any suggestions would be great.
#import <sys/sysctl.h>
+ (int) numberOfProcessors
{
int processors, error, selectors[2] = { CTL_HW, HW_NCPU };
size_t datasize = sizeof(processors);
error = sysctl(selectors, 2, &processors, &datasize, 0, 0);
return processors;
}
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.