我怎样才能知道 Android 设备中典型的 WiFi 扫描需要多少个指令周期?当然,它会因设备而异,但是有没有办法找到它呢?我正在使用日食。指令是:
wifiManager.startScan();
其中 wifiManager 是 WifiManager 类的实例。
我还想知道执行扫描(即执行上述指令)所需的时间(以毫秒为单位)。我发现它使用
System.currentTimeMillis();
但在开发人员网站上提到:
“此方法不应用于测量超时或其他经过时间的测量,因为更改系统时间可能会影响结果。”
这是什么意思??
任何帮助将不胜感激。谢谢。
How can i find out how many instruction cycles does a typical wifi scan take in an android device? Of course it will vary from device to device, but is there a way to find it out? I'm using eclipse. The instruction is:
wifiManager.startScan();
where wifiManager is an instance of WifiManager class.
I also want to know the time taken in milliseconds to perform the scan i.e. to execute the said instruction. I found it out using
System.currentTimeMillis();
But on the developers website it is mentioned:
"This method shouldn't be used for measuring timeouts or other elapsed time measurements, as changing the system time can affect the results."
What does this mean??
Any help would be appreciated. Thank you.
发布评论
评论(1)
这意味着您必须使用 System.currentTimeMillis();仅用于您的性能测试。
例子:
It means that you must use System.currentTimeMillis(); only for your performance tests.
Example: