---
title: "withInfiniteAnimationFrameMillis"
description: "Like [withFrameMillis], but applies the [InfiniteAnimationPolicy] from the calling
[CoroutineContext] if there is one."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
public suspend inline fun <R> withInfiniteAnimationFrameMillis(
    crossinline onFrame: (frameTimeMillis: Long) -> R
): R
```


Like `withFrameMillis`, but applies the `InfiniteAnimationPolicy` from the calling
`CoroutineContext` if there is one.



