https://kotlinlang.org logo
e

elizarov

12/31/2016, 12:01 AM
If all you need is to wait, then you don't need a future at all. This section gives a description and implementation of a very simple function
sleep
that you can add to your code (few lines). It implements a non-blocking sleep for a given time-period (non-blocking here means that it can be invoked in a coroutine and it does not block a thread): https://github.com/Kotlin/kotlin-coroutines/blob/revision-2.1/kotlin-coroutines-informal.md#non-blocking-sleep