Package 

Class TracingKt

    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> T traceSection(String sectionName, Function0<T> block) Runs block inside an Android trace section.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • traceSection

         final static <T extends Any> T traceSection(String sectionName, Function0<T> block)

        Runs block inside an Android trace section.

        try/finally is required so Trace.endSection is always called, even when block throws. Without this, begin/end calls can become unbalanced and later work appears in the wrong section.