在iOS 5中无法获得CPU频率? [英] Cannot get CPU frequency in iOS 5?

查看:196
本文介绍了在iOS 5中无法获得CPU频率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这曾经在iOS 5中运行但似乎不再有效:

This used to work in iOS 5 but does not seem to work any longer:

unsigned freq;
mib[0] = CTL_HW;
mib[1] = HW_CPU_FREQ;
sysctl (mib, 2, &freq, (void*) &len, NULL, 0);

有人知道其他选择吗?

谢谢。

推荐答案

Apple不提供所有硬件的CPU频率。例如,有一段时间不知道iPod touch 4g中A4的时钟频率是多少。

Apple doesn't provide the CPU frequency for all hardware. For example, it was unknown for some time exactly what the clock rate for the A4 in the iPod touch 4g was.

我认为您可以做的最好的事情是确定设备是什么,并构建一个查找表,其中包含您可以在维基百科上找到的CPU频率等等。然后,如果无法探测CPU频率,请在查找表中查找。

I think the best you can do is determine what the device is, and construct a lookup table with the CPU frequencies you can find on wikipedia and so on. Then, if you can't probe the CPU frequency, look it up in the lookup table.

这篇关于在iOS 5中无法获得CPU频率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆