All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lsd.core.TimeUtils.kt Maven / Gradle / Ivy

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