Android Guides | Samples

Android.Util.TimingLogger Class

A utility class to help log timings splits throughout a method call.

See Also: TimingLogger

Syntax

[Android.Runtime.Register("android/util/TimingLogger", DoNotGenerateAcw=true)]
public class TimingLogger : Object

Remarks

A utility class to help log timings splits throughout a method call. Typical usage is:

java Example

     TimingLogger timings = new TimingLogger(TAG, "methodA");
     // ... do some work A ...
     timings.addSplit("work A");
     // ... do some work B ...
     timings.addSplit("work B");
     // ... do some work C ...
     timings.addSplit("work C");
     timings.dumpToLog();

java Example

     D/TAG     ( 3459): methodA: begin
     D/TAG     ( 3459): methodA:      9 ms, work A
     D/TAG     ( 3459): methodA:      1 ms, work B
     D/TAG     ( 3459): methodA:      6 ms, work C
     D/TAG     ( 3459): methodA: end, 16 ms

The dumpToLog call would add the following to the log:

[Android Documentation]

Requirements

Namespace: Android.Util
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Util.TimingLogger are listed below.

See Also: Object

Public Constructors

Create and initialize a TimingLogger object that will log using the specific tag.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddSplit(String)
Add a split for the current time, labeled with splitLabel.
DumpToLog()
Dumps the timings to the log using Log.d().
Reset()
Clear and initialize a TimingLogger object that will log using the tag and label that was specified previously, either via the constructor or a call to reset(tag, label).
Reset(String, String)
Clear and initialize a TimingLogger object that will log using the specific tag.