AndroidUtils

测试函数的运行时间

inline fun measureTimeMillis(block: () -> Unit): Long {
    val startTime = System.currentTimeMillis()
    block()
    return System.currentTimeMillis() - startTime
}

val time = measureTimeMillis {
    // code to be measured here
}
println("Time taken: $time ms")

你可能感兴趣的:(java,开发语言)