[JS] Fix implement MonotonicTimeSource for d8
This commit is contained in:
@@ -31,9 +31,11 @@ internal actual object MonotonicTimeSource : DefaultTimeSource, TimeSource { //
|
|||||||
if (isNode)
|
if (isNode)
|
||||||
HrTimeSource(js("process").unsafeCast<Process>())
|
HrTimeSource(js("process").unsafeCast<Process>())
|
||||||
else
|
else
|
||||||
js("self").unsafeCast<GlobalPerformance?>()?.performance?.let(::PerformanceTimeSource)
|
js("typeof self !== 'undefined' ? self : globalThis")
|
||||||
|
.unsafeCast<GlobalPerformance?>()
|
||||||
|
?.performance
|
||||||
|
?.let(::PerformanceTimeSource)
|
||||||
?: DateNowTimeSource
|
?: DateNowTimeSource
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
actual override fun markNow(): ValueTimeMark = actualSource.markNow()
|
actual override fun markNow(): ValueTimeMark = actualSource.markNow()
|
||||||
|
|||||||
Reference in New Issue
Block a user