Calculates the time to wait before the given attempt.
The first attempt has number 0, the next one is 1, etc.