Tiempo de ejecución de la función de medida de Kotlin

fun measure(text: String, code: () -> Unit) {
    val time = measureTimeMillis(code)
    println("execution time of ${text}: ${time}ms")
}

measure("foo", {
	// <code-to-measure>
})
Determined Dunlin