We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
SuspendingClock.systemEpoch
1 parent 64e1f9d commit 3c64d2bCopy full SHA for 3c64d2b
Sources/Testing/Events/TimeValue.swift
@@ -54,7 +54,11 @@ struct TimeValue: Sendable {
54
55
@available(_clockAPI, *)
56
init(_ instant: SuspendingClock.Instant) {
57
+#if compiler(>=6.2)
58
+ self.init(SuspendingClock().systemEpoch.duration(to: instant))
59
+#else
60
self.init(unsafeBitCast(instant, to: Duration.self))
61
+#endif
62
}
63
64
@@ -110,7 +114,11 @@ extension Duration {
110
114
111
115
extension SuspendingClock.Instant {
112
116
init(_ timeValue: TimeValue) {
117
118
+ self = SuspendingClock().systemEpoch.advanced(by: Duration(timeValue))
119
113
120
self = unsafeBitCast(Duration(timeValue), to: SuspendingClock.Instant.self)
121
122
123
124
0 commit comments