Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace custom time handling with kotlin.time.TimeSource #260

Merged
merged 3 commits into from Feb 21, 2024

Conversation

hfhbd
Copy link
Contributor

@hfhbd hfhbd commented Feb 10, 2024

This is a binary breaking change.

The current implementation of TagConsumer.measureTime uses a custom time implementation. With Kotlin 1.9, TimeSource is finally stable so we can use it instead. This also allows us to use TimedValue.

Another advantage: The standard lib also provides a TimeSource.Monotonic for WASI, so adding WASI support removes the need to implement currentTimeMillis by ourself.


data class TimedResult<T>(val result: T, val time: Long)
val <O : Appendable> TimedValue<O>.out: O
Copy link
Contributor Author

@hfhbd hfhbd Feb 10, 2024

Choose a reason for hiding this comment

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

What's the reason for this extension? 🤔 You can call result/value directly.

src/commonMain/kotlin/trace-consumer.kt Outdated Show resolved Hide resolved
src/commonMain/kotlin/trace-consumer.kt Outdated Show resolved Hide resolved
@e5l e5l merged commit f1b51c6 into Kotlin:master Feb 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants