API reference@evolu/commonSchedule › delays

function delays<Output, Input>(
  schedule: Schedule<Output, Input>,
): Schedule<
  number &
    Brand<"Int"> &
    Brand<"NonNegative"> &
    Brand<"LessThan281474976710655"> &
    Brand<"Millis">,
  Input
>;

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

Outputs the delay between recurrences.

Wraps a schedule to output its delay (in milliseconds) instead of the original output. Useful for monitoring or logging delay patterns.

Example

// Monitor exponential delays
const monitorDelays = delays(exponential("100ms"));
// Outputs: 100, 200, 400, 800, ... (the delays themselves)

// Log delays for debugging
const logged = tapScheduleOutput(console.log)(delays(exponential("100ms")));