IMPORTANT: In July 2025, we stopped releasing new versions of KTX modules, and we removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the previously released KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
Creates a Trace object with given name and measures the time it takes to run the block wrapped by calls to start and stop.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
Measures the time it takes to run the block wrapped by calls to start and stop using HttpMetric.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
Measures the time it takes to run the block wrapped by calls to start and stop using Trace.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
[null,null,["Last updated 2025-07-21 UTC."],[],[],null,["# com.google.firebase.perf.ktx\n============================\n\nTop-level functions summary\n---------------------------\n\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inline T` | `\u003cT : `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?\u003e `~~[trace](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#trace(kotlin.String,kotlin.Function1))~~`(name: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, block: `[Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace)`.() `-\u003e` T)` **This function is deprecated.** Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |\n\nExtension functions summary\n---------------------------\n\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inline `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [HttpMetric](/docs/reference/kotlin/com/google/firebase/perf/metrics/HttpMetric)`.`~~[trace](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#(com.google.firebase.perf.metrics.HttpMetric).trace(kotlin.Function1))~~`(block: `[HttpMetric](/docs/reference/kotlin/com/google/firebase/perf/metrics/HttpMetric)`.() `-\u003e` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` **This function is deprecated.** Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |\n| `inline T` | `\u003cT : `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?\u003e `[Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace)`.`~~[trace](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#(com.google.firebase.perf.metrics.Trace).trace(kotlin.Function1))~~`(block: `[Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace)`.() `-\u003e` T)` **This function is deprecated.** Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |\n\nExtension properties summary\n----------------------------\n\n|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [FirebasePerformance](/docs/reference/kotlin/com/google/firebase/perf/FirebasePerformance) | [Firebase](/docs/reference/kotlin/com/google/firebase/ktx/Firebase)`.`[performance](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#(com.google.firebase.ktx.Firebase).performance()) Accessing this object for Kotlin apps has changed; see the [migration guide](https://firebase.google.com/docs/android/kotlin-migration). |\n\nTop-level functions\n-------------------\n\n### trace\n\n```\ninline fun \u003cT : Any?\u003e [trace](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#trace(kotlin.String,kotlin.Function1))(name: String, block: Trace.() -\u003e T): T\n```\n| **This function is deprecated.** \n| Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.\n\nCreates a [Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace) object with given [name](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#trace(kotlin.String,kotlin.Function1)) and measures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#trace(kotlin.String,kotlin.Function1)) wrapped by calls to start and stop.\n\n**Important** In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). **If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead** . For details, see the [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)\n\nExtension functions\n-------------------\n\n### trace\n\n```\ninline fun HttpMetric.[trace](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#(com.google.firebase.perf.metrics.HttpMetric).trace(kotlin.Function1))(block: HttpMetric.() -\u003e Unit): Unit\n```\n| **This function is deprecated.** \n| Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.\n\nMeasures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#(com.google.firebase.perf.metrics.HttpMetric).trace(kotlin.Function1)) wrapped by calls to start and stop using [HttpMetric](/docs/reference/kotlin/com/google/firebase/perf/metrics/HttpMetric).\n\n**Important** In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). **If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead** . For details, see the [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration) \n\n### trace\n\n```\ninline fun \u003cT : Any?\u003e Trace.[trace](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#(com.google.firebase.perf.metrics.Trace).trace(kotlin.Function1))(block: Trace.() -\u003e T): T\n```\n| **This function is deprecated.** \n| Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.\n\nMeasures the time it takes to run the [block](/docs/reference/kotlin/com/google/firebase/perf/ktx/package-summary#(com.google.firebase.perf.metrics.Trace).trace(kotlin.Function1)) wrapped by calls to start and stop using [Trace](/docs/reference/kotlin/com/google/firebase/perf/metrics/Trace).\n\n**Important** In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). **If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead** . For details, see the [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)\n\nExtension properties\n--------------------\n\n### performance\n\n```\nval Firebase.performance: FirebasePerformance\n```\n\nAccessing this object for Kotlin apps has changed; see the [migration guide](https://firebase.google.com/docs/android/kotlin-migration).\n\nReturns the [FirebasePerformance](/docs/reference/kotlin/com/google/firebase/perf/FirebasePerformance) instance of the default [FirebaseApp](/docs/reference/kotlin/com/google/firebase/FirebaseApp).\n\n**Important** In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). **If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead** . For details, see the [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)"]]