Skip to content

Commit

Permalink
Implement currentTimeMillis in androidx.compose.ui for web targets (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
eymar authored Feb 24, 2025
1 parent b343c53 commit 50ae9ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@

package androidx.compose.ui

import kotlinx.browser.window

internal actual fun areObjectsOfSameType(a: Any, b: Any): Boolean {
return (js(
"Object.getPrototypeOf(a).constructor == Object.getPrototypeOf(b).constructor"
)) as Boolean
}

internal actual fun currentTimeMillis(): Long {
return window.performance.now().toLong()
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

package androidx.compose.ui

import kotlinx.browser.window

internal actual fun areObjectsOfSameType(a: Any, b: Any): Boolean {
return a === b || a::class == b::class
}

internal actual fun currentTimeMillis(): Long {
return window.performance.now().toLong()
}

0 comments on commit 50ae9ad

Please sign in to comment.