datetime/timebox_exception library

Timebox: run within time budget — roadmap #618.

Functions

timebox<T>(Future<T> fn(), Duration timeout, {T? onTimeout}) Future<T>
Runs fn; if not completed in timeout, returns onTimeout result (or throws). Audited: 2026-06-12 11:26 EDT

Exceptions / Errors

TimeboxException
Thrown when timebox exceeds the allowed duration and no onTimeout was provided.