# TraceUtil

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/util/TraceUtil.java+class:androidx.media3.common.util.TraceUtil)

*** ** * ** ***


```
@UnstableApi
public final class TraceUtil
```

<br />

*** ** * ** ***

Calls through to `https://developer.android.com/reference/android/os/Trace.html` methods if `https://developer.android.com/reference/androidx/media3/common/MediaLibraryInfo#TRACE_ENABLED()` is `true`.

## Summary

| ### Public methods |
|---|---|
| `static void` | `https://developer.android.com/reference/androidx/media3/common/util/TraceUtil#beginSection(java.lang.String)(https://developer.android.com/reference/java/lang/String.html sectionName)` Writes a trace message to indicate that a given section of code has begun. |
| `static void` | `https://developer.android.com/reference/androidx/media3/common/util/TraceUtil#endSection()()` Writes a trace message to indicate that a given section of code has ended. |

## Public methods

### beginSection

```
public static void beginSection(String sectionName)
```

Writes a trace message to indicate that a given section of code has begun.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html sectionName` | The name of the code section to appear in the trace. This may be at most 127 Unicode code units long. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/os/Trace.html#beginSection(java.lang.String)` |   |

### endSection

```
public static void endSection()
```

Writes a trace message to indicate that a given section of code has ended.

| See also |
|---|---|
| `https://developer.android.com/reference/android/os/Trace.html#endSection()` |   |