to top
Android APIs
public static class

Debug.InstructionCount

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

Class Overview

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

? Examples
Debug.InstructionCount()
Public Methods

? Examples
boolean collect()
Collect instruction counts.

? Examples
int globalMethodInvocations()
Return the total number of method-invocation instructions executed globally.

? Examples
int globalTotal()
Return the total number of instructions executed globally (i.e.

? Examples
boolean resetAndStart()
Reset counters and ensure counts are running.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Debug.InstructionCount ()

Added in API level 1

Public Methods

public boolean collect ()

Added in API level 1

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

public int globalMethodInvocations ()

Added in API level 1

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

public int globalTotal ()

Added in API level 1

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

public boolean resetAndStart ()

Added in API level 1

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

Returns
  • true if counting was started
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.