Answers for "kotlin measure function execution time"

0

kotlin measure function execution time

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

measure("foo", {
	// <code-to-measure>
})
Posted by: Guest on April-30-2022

Code answers related to "kotlin measure function execution time"

Browse Popular Code Answers by Language