com.lsd.core.TimeUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lsd-core Show documentation
Show all versions of lsd-core Show documentation
A library used to generate living sequence diagrams
The newest version!
package com.lsd.core
import java.time.Duration
import java.time.Instant
fun timedResult(block: () -> R): Pair {
val start = Instant.now()
val result = block.invoke()
val stop = Instant.now()
return Duration.between(start, stop) to result
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy