Jason
01/13/2022, 10:55 AM/***
* I dont know when `condition` come true but It will be true after waiting 3,4 seconds time
* So I want to wait until condition come true . If not come true within 1minutes throw timeoutException
***/
fun execute {
withTimeout(10_000) {
while (true) {
if(condition == true) -> cancel timeout then using condition in next step
}
}
// Next step
condition is true and I will handle it.
}
How to implement this function in Kotlin?