1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-03-26 23:50:16 +08:00

Fix measureTimeMillis

This commit is contained in:
Him188 2022-06-08 20:20:33 +01:00
parent afa1cd2395
commit 7999aa2aea
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -12,5 +12,7 @@
package net.mamoe.mirai.utils
public actual inline fun measureTimeMillis(block: () -> Unit): Long {
return kotlin.system.measureTimeMillis(block)
val start = currentTimeMillis() // getTimeMillis in stdlib doesn't work on some native targets.
block()
return currentTimeMillis() - start
}