[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) › jitter

```ts
function jitter(
  percentage?: Percentage,
  mode?: "below" | "around",
): <Output, Input>(
  schedule: Schedule<Output, Input>,
) => Schedule<Output, Input>;
```

Defined in: [packages/common/src/Schedule.ts:927](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Schedule.ts#L927)

Randomizes delays by up to a percentage.

Jitter helps prevent "thundering herd" when many clients retry simultaneously
after a service recovers. By default, the original delay is the upper bound:

- `"0%"` — no jitter (original delay)
- `"50%"` — equal jitter, shortens the delay by up to 50%
- `"100%"` — full jitter, shortens the delay by up to 100%

Pass `"around"` to preserve the average delay for periodic work:

- `"0%"` — no jitter (original delay)
- `"50%"` — varies by up to 50% below or above the original delay
- `"100%"` — varies by up to 100% below or above the original delay

### Jittering below or around a delay

```ts
import {
  assertOk,
  exponential,
  jitter,
  spaced,
  testCreateDeps,
  type RandomNumber,
} from "@evolu/common";

const deps = {
  ...testCreateDeps(),
  random: { next: () => 0.5 as RandomNumber },
};

// Shorten retry delays by at most 25%.
const conservative = jitter("25%")(exponential("1s"));
// Poll around a 30s target cadence, from 27s to 33s.
const polling = jitter("10%", "around")(spaced("30s"));

assertOk(conservative(deps)(undefined), [1000, 875]);
assertOk(polling(deps)(undefined), [30000, 30000]);
```