Package-level declarations
Types
Link copied to clipboard
class Deadline(val timeout: Duration, timeSource: TimeSource.WithComparableMarks = TimeSource.Monotonic)
A fixed time budget that starts counting down at construction.
Link copied to clipboard
class RateLimiter(val permits: Int, val per: Duration, timeSource: TimeSource.WithComparableMarks = TimeSource.Monotonic)
Link copied to clipboard
A stopwatch that accumulates elapsed time across start and stop cycles.
Functions
Link copied to clipboard
Link copied to clipboard
Formats this duration as a colon-separated clock string, such as "01:23:45".
Link copied to clipboard
Formats this duration as its most significant components, such as "1h 23m".
Link copied to clipboard
Parses a clock string produced by formatClock back into a Duration.
Link copied to clipboard
Parses a clock string produced by formatClock, or returns null when text is not valid.
Link copied to clipboard
Rounds this duration to the nearest whole hour.
Link copied to clipboard
Rounds this duration to the nearest whole minute.
Link copied to clipboard
Rounds this duration to the nearest whole second.
Link copied to clipboard
suspend fun <T> withMinimumDuration(minimum: Duration, timeSource: TimeSource.WithComparableMarks = TimeSource.Monotonic, block: suspend () -> T): T