-
-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e6ac7c
commit 0a10adc
Showing
5 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
core/koin-core/src/commonMain/kotlin/org/koin/mp/KoinPlatformTimeTools.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.koin.mp | ||
|
||
expect object KoinPlatformTimeTools { | ||
fun getTimeInNanoSeconds() : Long | ||
} |
9 changes: 9 additions & 0 deletions
9
core/koin-core/src/jsMain/kotlin/org/koin/mp/PlatformTimeToolsJS.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.koin.mp | ||
|
||
import kotlin.math.roundToLong | ||
|
||
actual object KoinPlatformTimeTools { | ||
actual fun getTimeInNanoSeconds() : Long { | ||
return (js("self.performance.now()") as Double * 1_000_000).roundToLong() | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
core/koin-core/src/jvmMain/kotlin/org/koin/mp/PlatformTimeToolsJVM.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.koin.mp | ||
|
||
actual object KoinPlatformTimeTools { | ||
actual fun getTimeInNanoSeconds() : Long { | ||
return System.nanoTime() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
core/koin-core/src/nativeMain/kotlin/org/koin/mp/PlatformTimeToolsNative.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.koin.mp | ||
|
||
import kotlin.system.getTimeNanos | ||
|
||
actual object KoinPlatformTimeTools { | ||
actual fun getTimeInNanoSeconds() : Long { | ||
return getTimeNanos() | ||
} | ||
} |