Travis Griggs
04/03/2020, 12:20 AMthis.timer = Timer()
this.timer?.scheduleAtFixedRate(timerTask { simulate() }, 0L, 5000L)
I’m not a fan of this solution, because this
isn’t what I expect this to be in that case. But when in rome, I guess? Or is there a different more modern idiomatic way to cause a real closure to tick at a rate?tseisel
04/03/2020, 8:20 AMscope.launch {
while (true) {
doSomething()
delay(5000L)
}
}