kotlin-times / kt.times / kotlin.Int

Extensions for kotlin.Int

times operator infix fun Int.times(action: (Int) -> Unit): Unit

Allows to repeat an action N times, where N is an Int value on which this method is invoked. Since this method is marked as inline, there should be no runtime overhead of using this method over simple range iteration (or its Java for-loop equivalent, for that matter).