Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MasoudFallahpour/f7df9d97c5645b7fea874fd6bb1e149a to your computer and use it in GitHub Desktop.
Save MasoudFallahpour/f7df9d97c5645b7fea874fd6bb1e149a to your computer and use it in GitHub Desktop.
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
fun main() = runBlocking {
launch(Dispatchers.Unconfined) {
println("Before delay. Thread name: ${Thread.currentThread().name}")
delay(500)
println("After delay. Thread name: ${Thread.currentThread().name}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment