instant math for throttle

This commit is contained in:
Philippe Hausler committed 2022-02-18 00:07:55 -08:00
1 parent 46b3bb088b
commit aebc7af342
1 file changed
+1 -1
@@ -77,7 +77,7 @@ extension AsyncThrottleSequence: AsyncSequence {
return nil
}
let reduction = await reducing(reduced, element)
if clock.now - start >= interval {
if start.duration(to: clock.now) >= interval {
return reduction
} else {
reduced = reduction