[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:867](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Schedule.ts#L867)

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]);
```