Android
android.os
public static class

android.os.Debug.InstructionCount

java.lang.Object
android.os.Debug.InstructionCount

API for gathering and querying instruction counts. Example usage: 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()); }

Summary

Public Constructors

            Debug.InstructionCount()

Public Methods

          boolean  collect()
Collect instruction counts.
          int  globalMethodInvocations()
Return the total number of method-invocation instructions executed globally.
          int  globalTotal()
Return the total number of instructions executed globally (i.e.
          boolean  resetAndStart()
Reset counters and ensure counts are running.
Methods inherited from class java.lang.Object

Details

Public Constructors

public Debug.InstructionCount()

Public Methods

public boolean collect()

Collect instruction counts. May or may not stop the counting process.

public int globalMethodInvocations()

Return the total number of method-invocation instructions executed globally.

public int globalTotal()

Return the total number of instructions executed globally (i.e. in all threads).

public boolean resetAndStart()

Reset counters and ensure counts are running. Counts may have already been running.

Returns

  • true if counting was started
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56