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

```ts
function during(
  duration: Duration,
): Schedule<
  number &
    Brand<"NonNaN"> &
    Brand<"Finite"> &
    Brand<"Int"> &
    Brand<"NonNegative"> &
    Brand<"LessThan281474976710655"> &
    Brand<"Millis">
>;
```

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

A schedule that runs for a specified duration then stops.

Outputs the elapsed time. Useful for time-boxed operations or combining with
other schedules to create time-limited variants.

### Time-boxing a schedule

```ts
import {
  assertErr,
  assertOk,
  done,
  during,
  exponential,
  intersectSchedules,
  testCreateDeps,
} from "@evolu/common";

// Run for at most 30 seconds.
const timeLimited = during("30s");
const deps = testCreateDeps();
const step = timeLimited(deps);
assertOk(step(undefined), [0, 0]);
deps.time.advance("30.1s");
assertErr(step(undefined), done());

// Combine elapsed time with backoff for a time-boxed retry.
const timedRetry = intersectSchedules(exponential("100ms"), during("10s"));
assertOk(timedRetry(testCreateDeps())(undefined), [[100, 0], 100]);
```