# SurfaceControl.TransactionStats

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# TransactionStats

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/SurfaceControl.TransactionStats "View this page in Java")  

```
class TransactionStats
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                               ||
| ↳ | [android.view.SurfaceControl.TransactionStats](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.TransactionStats#) |

Transaction stats given to the listener registered in[SurfaceControl.Transaction.addTransactionCompletedListener](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.Transaction#addTransactionCompletedListener(java.util.concurrent.Executor,%20java.util.function.Consumer))

## Summary

|                                                                                                                                                                        Public methods                                                                                                                                                                         ||
|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)                 | [getLatchTimeNanos](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.TransactionStats#getLatchTimeNanos())`()` Returns the timestamp (in CLOCK_MONOTONIC) of when the frame was latched by the framework and queued for presentation. |
| [SyncFence](https://developer.android.com/reference/kotlin/android/hardware/SyncFence.html#) | [getPresentFence](https://developer.android.com/reference/kotlin/android/view/SurfaceControl.TransactionStats#getPresentFence())`()` Returns a new SyncFence that signals when the transaction has been presented.                                              |

## Public methods

### getLatchTimeNanos

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getLatchTimeNanos(): Long
```

Returns the timestamp (in CLOCK_MONOTONIC) of when the frame was latched by the framework and queued for presentation.  

### getPresentFence

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getPresentFence(): SyncFence
```

Returns a new SyncFence that signals when the transaction has been presented. The caller takes ownership of the fence and is responsible for closing it by calling[SyncFence.close](https://developer.android.com/reference/kotlin/android/hardware/SyncFence.html#close()). If a device does not support present fences, an empty fence will be returned.

|                                                          Return                                                           ||
|----------------------------------------------------------------------------------------------|-----------------------------|
| [SyncFence](https://developer.android.com/reference/kotlin/android/hardware/SyncFence.html#) | This value cannot be`null`. |