I have issue for fetching CUP_Frequency in iphone, ipad devices and simulator.
size_t length;
int mib[6];
int result;
mib[0] = CTL_HW;
mib[1] = HW_CPU_FREQ;
length = sizeof(result);
if (sysctl(mib, 2, &result, &length, NULL, 0) < 0)
{
perror("getting cpu frequency");
}
cpuFre=[NSString stringWithFormat:@"%.2f Mhz",(float)result];
I am using this code for fetching CPU frequency but answer is strange in each device like. In simulator it gives -(minus)value and in ipad it gives 0 and iphone it gives fix 600 MHz value.
What is value of ipad and i know that CPU Frequency of simulator is 2400 MHz but it gives minus value.
What to do???