# TraceUtil

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/common/util/TraceUtil "View this page in Java")

<br />

```
@UnstableApi
class TraceUtil
```

<br />

*** ** * ** ***

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

## Summary

|                                    ### Public functions                                     |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [beginSection](https://developer.android.com/reference/kotlin/androidx/media3/common/util/TraceUtil#beginSection(java.lang.String))`(sectionName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Writes a trace message to indicate that a given section of code has begun. |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [endSection](https://developer.android.com/reference/kotlin/androidx/media3/common/util/TraceUtil#endSection())`()` Writes a trace message to indicate that a given section of code has ended.                                                                                                                      |

## Public functions

### beginSection

```
java-static fun beginSection(sectionName: String!): Unit
```

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

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| `sectionName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The name of the code section to appear in the trace. This may be at most 127 Unicode code units long. |

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

### endSection

```
java-static fun endSection(): Unit
```

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

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