Also personally, I've found it more useful to retu...
# announcements
c
Also personally, I've found it more useful to return both the duration and the result of the block:
Copy code
fun <T> benchmarkMillis(run: () -> T) : Pair<Long, T> {
    val start = System.currentTimeMillis()
    val result = run()
    return Pair(System.currentTimeMillis() - start, result)
}
­čĹŹ 4