> For the complete documentation index, see [llms.txt](https://gold.gitbook.io/kotlin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gold.gitbook.io/kotlin/kotlin-standard/repeat.md).

# repeat

```kotlin
//times 와 익명함수 하나를 받아 times - 1 번 만큼 인자로 받은 익명함수를 반복실행한다.
inline fun repeat(times: Int, action: (Int) -> Unit) {
    for (index in 0..times - 1) {
        action(index)
    }
}
```

```kotlin
repeat(4, {println("Hello, World!")})
// Hello, World!
// Hello, World!
// Hello, World!
// Hello, World!
```
