Timely

object Timely(source)

Functions relating to time-limited behavior.

Properties

Link copied to clipboard
const val GENERATOR_TIMEOUT: Long = 5000

The timeout in milliseconds before the generator should be interrupted when generating a value.

Functions

Link copied to clipboard
fun <T> generateTimely(generator: () -> T): T

Runs the generator and returns its return value, or throws an exception if it takes longer than GENERATOR_TIMEOUT milliseconds.