Skip to content

Conversation

qurbonzoda
Copy link
Contributor

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

@qurbonzoda qurbonzoda added the kotlin-merge-blocker PRs labeled as merge-blockers are effectively preventing a corresponding merge into main Kotlin repo label Oct 3, 2024
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
@qurbonzoda qurbonzoda force-pushed the qurbonzoda/fix-aggregate-build branch from 134a9c8 to 4c9ffd2 Compare October 8, 2024 07:22
@qurbonzoda qurbonzoda changed the base branch from kotlin-community/k2/dev to develop October 8, 2024 07:23
@qurbonzoda qurbonzoda changed the title Suppress a usage of deprecated getTimeNanos() in K/N Replace a usage of deprecated getTimeNanos() in K/N Oct 8, 2024
@qurbonzoda qurbonzoda merged commit 9749b8c into develop Oct 8, 2024
1 check passed
internal actual fun nanoTime(): Long = getTimeNanos()
private val startingPoint = TimeSource.Monotonic.markNow()

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip: You could use startingPoint.elapsedNow instead of subtracting marks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kotlin-merge-blocker PRs labeled as merge-blockers are effectively preventing a corresponding merge into main Kotlin repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants