# TraceKt

Added in 1.1.0

*** ** * ** ***


```
public final class TraceKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> [trace](https://developer.android.com/reference/androidx/core/os/TraceKt#trace(kotlin.String,kotlin.Function0))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html sectionName, @https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull T> block )` **This method is deprecated.** Use androidx.tracing.Trace instead |

## Public methods

### trace

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/os/Trace.kt+function:trace) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final @NonNull T <T extends Object> [trace](https://developer.android.com/reference/androidx/core/os/TraceKt#trace(kotlin.String,kotlin.Function0))(
    @NonNull String sectionName,
    @NonNull Function0<@NonNull T> block
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use androidx.tracing.Trace instead, use this instead:
>
> ```
> trace(sectionName, block)
> ```

Wrap the specified `https://developer.android.com/reference/androidx/core/os/package-summary#trace(kotlin.String,kotlin.Function0)` in calls to `https://developer.android.com/reference/android/os/Trace.html#beginSection(java.lang.String)` (with the supplied `https://developer.android.com/reference/androidx/core/os/package-summary#trace(kotlin.String,kotlin.Function0)`) and `https://developer.android.com/reference/android/os/Trace.html#endSection()`.