Is there an equivalent to JVM's Thread.sleep() in pure Kotlin for use on MPP projects? This could be implemented on each platform using expected
, but I am asking about a solution that does not use that method.
This can be done using coroutines.
For example:
runBlocking {
println("Wait for 5sec")
delay(5000)
println("Done waiting for 5sec")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With