commonMain.io.github.lyxnx.util.time.Duration.kt Maven / Gradle / Ivy
package io.github.lyxnx.util.time
import kotlin.jvm.JvmSynthetic
import kotlin.time.Duration
/**
* Sums all the durations within this iterable
*
* If the iterable is empty, the result is [Duration.ZERO]
*/
@JvmSynthetic // kotlin Duration is a value class, so to the JVM is represented as a long instead
public fun Iterable.sum(): Duration = fold(Duration.ZERO, Duration::plus)