kotest-assertions / io.kotest.assertions.until / FibonacciInterval

FibonacciInterval

class FibonacciInterval : Interval

Fibonacci delay implements a delay where each duration is calculated as a multiplier of the fibonacci sequence, 0, 1, 1, 2, 3, 5....

Some people start fib at 0, some at 1. This implementation starts with 0 as per https://en.wikipedia.org/wiki/Fibonacci_number

Parameters

offset - Added to the count, so if the offset is 4, then the first value will be the 4th fib number.

base - The duration that is multiplied by the fibonacci value

Constructors

<init>

Fibonacci delay implements a delay where each duration is calculated as a multiplier of the fibonacci sequence, 0, 1, 1, 2, 3, 5....

FibonacciInterval(base: Duration, offset: Int)

Functions

next

Returns the next delay as a Duration.

fun next(count: Int): Duration