[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Schedule](https://evolu.dev/docs/api-reference/common/Schedule) › maxDelay

```ts
function maxDelay(
  max: Duration,
): <Output, Input>(
  schedule: Schedule<Output, Input>,
) => Schedule<Output, Input>;
```

Defined in: [packages/common/src/Schedule.ts:859](https://github.com/evoluhq/evolu/blob/dd96d79f1dbe9a49fa12ce8e0aa7d3d0177795ca/packages/common/src/Schedule.ts#L859)

Caps the delay to a maximum value.

If the schedule returns a delay greater than `max`, returns `max` instead.

### Capping delays

```ts

// Exponential delays grow 1s, 2s, 4s, 8s, then stay capped at 10s.
const step = maxDelay("10s")(exponential("1s"))(testCreateDeps());
step(undefined);
step(undefined);
step(undefined);
step(undefined);
assertOk(step(undefined), [16000, 10000]);
```