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

```ts
function compensate<Output, Input>(
  schedule: Schedule<Output, Input>,
): Schedule<Output, Input>;
```

Defined in: [packages/common/src/Schedule.ts:781](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Schedule.ts#L781)

Adjusts delay by subtracting execution time.

A simple combinator that subtracts the previous execution time from the
schedule's delay. If execution took longer than the delay, returns 0.

For window-aligned scheduling, use [fixed](https://evolu.dev/docs/api-reference/common/Schedule/functions/fixed) instead.

### Example

```ts
// Poll every 5s, accounting for execution time
const polling = compensate(spaced("5s"));
// If poll takes 1s → wait 4s. If poll takes 6s → wait 0s.
```