You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like this library, so I thought I'd mention some weird behaviour I encountered while unit testing.
I set my clock rate at x100 to speed everything up during tests, but noticed some inaccuracies while doing this. Maybe this is just an example of #42 ?
var cancels: [AnyCancellable] = []
let fixedStart = Clocks.system.nextHour().firstInstant
let fastClock = Clocks.custom(startingFrom: fixedStart, rate: 100)
fastClock
.chime(at: fastClock.thisSecond() + .seconds(10))
.sink { _ in
print("chimed at \(fastClock.now().date)")
}
.store(in: &cancels)
fastClock
.chime(at: fastClock.thisSecond() + .seconds(17))
.sink { _ in
print("chimed at \(fastClock.now().date)")
}
.store(in: &cancels)
// chimed at 2023-08-21 12:00:10 +0000
// chimed at 2023-08-21 12:00:47 +0000
The first chime works as expected, but for any value above 17 'seconds' the timing is off.
The text was updated successfully, but these errors were encountered:
Hi there
I really like this library, so I thought I'd mention some weird behaviour I encountered while unit testing.
I set my clock rate at x100 to speed everything up during tests, but noticed some inaccuracies while doing this. Maybe this is just an example of #42 ?
The first chime works as expected, but for any value above 17 'seconds' the timing is off.
The text was updated successfully, but these errors were encountered: