jeggy
08/17/2020, 6:09 PMinline fun measureTimeMillisWithContract(block: () -> Unit): Long {
contract {
callsInPlace(block, EXACTLY_ONCE)
}
val start = System.currentTimeMillis()
block()
return System.currentTimeMillis() - start
}
but as it requires me to add the @ExperimentalContracts
annotation, I don't really feel good to use contracts.nanodeath
08/17/2020, 6:16 PMmeasureTimeMillis
doesn't have this alreadyjeggy
08/17/2020, 6:17 PMephemient
08/17/2020, 6:18 PMilya.gorbunov
08/17/2020, 6:22 PMit is weird the built-in measureTimeMillis doesn't have this alreadyDoes have it already: https://kotlinlang.slack.com/archives/C0922A726/p1597687744182700