Added in API level 1
Deprecated in API level 23

InstructionCount


class InstructionCount
kotlin.Any
   ↳ 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

Public methods
open Boolean

Collect instruction counts.

open Int

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

open Int

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

open Boolean

Reset counters and ensure counts are running.

Public constructors

InstructionCount

Added in API level 1
InstructionCount()

Public methods

collect

Added in API level 1
open fun collect(): Boolean

Deprecated: Deprecated in Java.

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

globalMethodInvocations

Added in API level 1
open fun globalMethodInvocations(): Int

Deprecated: Deprecated in Java.

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

globalTotal

Added in API level 1
open fun globalTotal(): Int

Deprecated: Deprecated in Java.

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

resetAndStart

Added in API level 1
open fun resetAndStart(): Boolean

Deprecated: Deprecated in Java.

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

Return
Boolean true if counting was started