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

```ts
function windowed(interval: Duration): Schedule<number>;
```

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

Divides the timeline into fixed windows and sleeps until the next boundary.

Similar to [fixed](https://evolu.dev/docs/api-reference/common/Schedule/functions/fixed), but always sleeps until the next window boundary
regardless of when the last execution started. Outputs the repetition count.

Useful for aligning executions to regular intervals from the start time.

### Example

```ts
// Execute at regular 5-second boundaries from start
const aligned = windowed("5s");
// If elapsed is 3s, waits 2s. If elapsed is 7s, waits 3s.
```