public static class Debug.InstructionCount
extends Object
| java.lang.Object | |
| android.os.Debug.InstructionCount | |
此类在API级别23中已被弃用。
指令计数不再受支持。
用于收集和查询指令计数的API。 用法示例:
Debug.InstructionCount icount = new Debug.InstructionCount();
icount.resetAndStart();
[... do lots of stuff ...]
if (icount.collect()) {
System.out.println("Total instructions executed: "
+ icount.globalTotal());
System.out.println("Method invocations: "
+ icount.globalMethodInvocations());
}
Public constructors |
|
|---|---|
Debug.InstructionCount() |
|
公共方法(Public methods) |
|
|---|---|
boolean |
collect() 收集指令数量。 |
int |
globalMethodInvocations() 返回全局执行的方法调用指令的总数。 |
int |
globalTotal() 返回全局执行的指令总数(即 |
boolean |
resetAndStart() 重置计数器并确保计数正在运行。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
int globalMethodInvocations ()
返回全局执行的方法调用指令的总数。
| 返回(Returns) | |
|---|---|
int |
|
boolean resetAndStart ()
重置计数器并确保计数正在运行。 计数可能已经在运行。
| 返回(Returns) | |
|---|---|
boolean |
true if counting was started |