package com.beust.kobalt.misc

fun benchmarkMillis(run: () -> Unit) : Long {
    val start = System.currentTimeMillis()
    run()
    return System.currentTimeMillis() - start
}

fun benchmarkSeconds(run: () -> Unit) = benchmarkMillis(run) / 1000




package com.beust.kobalt.misc

fun <T> benchmarkMillis(run: () -> T) : Pair<Long, T> {
    val start = System.currentTimeMillis()
    val result = run()
    return Pair(System.currentTimeMillis() - start, result)
}

fun <T> benchmarkSeconds(run: () -> T) : Pair<Long, T> {
    val result = benchmarkMillis(run)
    return Pair(result.first / 1000, result.second)
}




Return pairs for benchmark functions.
Return pairs for benchmark functions.

ethauvin/kobalt,ethauvin/kobalt,cbeust/kobalt,ethauvin/kobalt,cbeust/kobalt,cbeust/kobalt,ethauvin/kobalt