Calculate exponential backoff/retry delay. Where attempts >= 1, exp > 1

expBackoff(1000, 30000, attempts)
---------------------------------
attempts | possible delay
----------+----------------------
1 | 1000 to 2000
2 | 1000 to 4000
3 | 1000 to 8000
4 | 1000 to 16000
5 | 1000 to 30000
---------------------------------
Attempts required before max delay is possible = Math.ceil(Math.log(high/step) / Math.log(exp))

1.0.0

  • Parameters

    • step: number
    • high: number
    • attempts: number
    • exp: number = 2

    Returns number