timeout

suspend fun <T> timeout(ticks: Ticks, block: suspend TaskSequenceBuilder.() -> T): T?

Runs the block with a timeout. If the block takes longer than ticks, it will be cancelled.

Return

The result of the block, or null if it timed out.

Parameters

ticks

The timeout duration in ticks.

block

The block to execute.