Skip to content

Commit

Permalink
Replace a usage of deprecated getTimeNanos() in K/N (#4238)
Browse files Browse the repository at this point in the history
The function was deprecated with warning in Kotlin 1.9.
In Kotlin 2.1 the deprecation level will be raised to error.

See KT-71628
  • Loading branch information
qurbonzoda authored Oct 8, 2024
1 parent 1c840d6 commit 9749b8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kotlinx-coroutines-core/native/src/EventLoop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package kotlinx.coroutines

import kotlin.coroutines.*
import kotlin.native.concurrent.*
import kotlin.system.*
import kotlin.time.*

internal actual abstract class EventLoopImplPlatform : EventLoop() {

Expand All @@ -26,5 +26,6 @@ internal class EventLoopImpl: EventLoopImplBase() {

internal actual fun createEventLoop(): EventLoop = EventLoopImpl()

@Suppress("DEPRECATION")
internal actual fun nanoTime(): Long = getTimeNanos()
private val startingPoint = TimeSource.Monotonic.markNow()

internal actual fun nanoTime(): Long = (TimeSource.Monotonic.markNow() - startingPoint).inWholeNanoseconds

0 comments on commit 9749b8c

Please sign in to comment.