import java.time.Instant fun main() { val now = Instant.now() val micros = now.toEpochMilli() * 1000 + now.getNano() / 1000 println("当前时间戳 (微秒): $micros") }
代码解释:
输出:
输出将类似于:
当前时间戳 (微秒): 1700000000000000
注意: