Throttler
Throttler copied to clipboard
Throttle runs first request with a delay
I set throttle for every 3 seconds, but have a delay for 3 seconds for the first request. Was it intended that way?
print("\(Date().toString(format: "HH:mm:ss")): Begin")
for i in 1...10000 {
throttle(.seconds(3)) {
print("\(Date().toString(format: "HH:mm:ss")): throttle: \(i)")
}
}