File tree Expand file tree Collapse file tree
sampleApp/src/commonMain/kotlin/com/softartdev/kronos/sample Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Kronos Multiplatform Library
2- Development in progress 🛠
2+
3+ ![ Maven Central] ( https://img.shields.io/maven-central/v/io.github.softartdev/kronos )
4+ [ ![ Build & Publish CI/CD] ( https://github.com/softartdev/Kronos-Multiplatform/actions/workflows/build_publish.yml/badge.svg )] ( https://github.com/softartdev/Kronos-Multiplatform/actions/workflows/build_publish.yml )
35
46Kotlin Multiplatform library for time synchronization.
57Extension for [ kotlinx-datetime] ( https://github.com/Kotlin/kotlinx-datetime ) library.
Original file line number Diff line number Diff line change @@ -63,7 +63,12 @@ internal expect suspend fun clickAwaitSync()
6363private fun calcDiffDuration (): Duration {
6464 val sysInstant = Clock .System .now()
6565 Napier .d(tag = " ⌚️" , message = " System time: $sysInstant " )
66- val netInstant = Clock .Network .now()
66+ val netInstant = try {
67+ Clock .Network .now()
68+ } catch (exception: IllegalArgumentException ) {
69+ Napier .e(tag = " ⌚️" , message = exception.message ? : " Network time error" )
70+ sysInstant
71+ }
6772 Napier .d(tag = " ⌚️" , message = " Network time: $netInstant " )
6873 val diff: Duration = netInstant - sysInstant
6974 Napier .d(tag = " ⌚️" , message = " Diff: $diff " )
You can’t perform that action at this time.
0 commit comments