API reference@evolu/commonSchedule › during

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

Defined in: packages/common/src/Schedule.ts:478

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.

Example

// Run for at most 30 seconds
const timeLimited = during("30s");

// Combine with exponential for time-boxed retry
const timedRetry = intersectSchedules(exponential("100ms"), during("10s"));