He
12/05/2022, 3:00 AMfun wait(){
val timeout= TimeHelper.getNow() + timeoutInterval // <- part of class constructor
if(processor.getLag() > 0){
val currentTIme = TimeHelper.getNow()
if(currentTime >= timeout){ System.exit(42) }
Thread.sleep(someTime)
}
}
And want to use a coroutine runBlocking
and delay
, would it be something like
fun wait() = runBlocking{
launch { delayMethod() }
if(processor.getLag() > 0){
val currentTIme = TimeHelper.getNow()
if(currentTime >= timeout){ System.exit(42) }
}
}
suspend fun delayMethod(){
delay(someTime)
}
gildor
12/05/2022, 6:41 AMgildor
12/05/2022, 6:41 AMgildor
12/05/2022, 6:42 AMwait()