backoff
backoff(
attempt,options?):number
Defined in: src/time.ts:128
How long to wait before retry number attempt, counting from 0.
Retrying on a fixed schedule makes every client in a fleet retry at the same instant; the jitter strategies exist to break that up.
Parameters
Section titled “Parameters”attempt
Section titled “attempt”number
options?
Section titled “options?”BackoffOptions = {}
Returns
Section titled “Returns”number
Example
Section titled “Example”backoff(0); // 87.3 around 100msbackoff(1); // 213.9 around 200msbackoff(4); // 1483.2 around 1.6s, capped by maxDelay
backoff(3, { base: 250, factor: 3, jitter: "equal" });