如何检测机器人CPU速度?机器人、速度、CPU

2023-09-12 03:23:11 作者:DIE°

我想检测怎么快上我的Andr​​oid应用程序正在运行的设备?

I would like to detect how fast is the device on which my Android application is running?

有没有API来做到这一点在Android?还是我必须以基准IT由我自己?

Is there any API to do it on Android? Or do I have to benchmark it by myself?

如果设备有缓慢的CPU,我想关闭一些费时如动画的同时HTTP请求或限制最大数量的操作。

If the device has slow CPU I would like to turn off some time consuming operations like animations or limit maximum number of simultaneous HTTP request.

推荐答案

要做到这一点,我认为最好的办法是监视它需要做这些动作的时候。如果是服用了太多的时间,那么系统速度太慢,你可以禁用花哨的功能,直到它足够快。

The best way to do it in my opinion is to monitor the time it takes to do these actions. If it is taking too much time, then the system is too slow and you can disable fancy features until it is fast enough.

读取CPU速度或其它规格,并试图判断系统的运行速度是一个坏主意。未来的硬件变化可能使这些规范意义的。

Reading the CPU speed or other specs and attempting to judge the system speed is a bad idea. Future hardware changes might make these specs meaningless.

看奔腾4 VS酷睿2为例。这是更快的CPU,2.4 GHz奔腾4或1.8 GHz的Core 2?是一个2 GHz的Opteron处理器比1.4GHz的安腾2处理器速度更快?你怎么会知道什么样的ARM CPU的实际上是更快?

Look at the Pentium 4 vs the Core 2 for example. Which is the faster CPU, a 2.4 GHz Pentium 4, or the 1.8 GHz Core 2? Is a 2 GHz Opteron faster than a 1.4 GHz Itanium 2? How are you going to know what kind of ARM CPU is actually faster?

要获取系统速度等级为Windows Vista和7微软实际上基准机器。这是唯一的中途准确的方法,以确定系统的功能

To get system speed ratings for Windows Vista and 7 Microsoft actually benchmarks the machine. This is the only halfway accurate method to determine system capabilities.

它看起来像一个很好的方法是使用SystemClock.uptimeMillis().

It looks like a good method is to use SystemClock.uptimeMillis().